PageSourceSearch

https://www.alvalabs.io/hubfs/hub_generated/template_assets/1/2106…/template_scroll-animations.min.js

js alvalabs.io collected 2026-10-02 05:22:09 UTC 8,871 bytes, 2 lines download raw bytes

1!function(){"use strict";var EASING="cubic-bezier(0.12, 0.23, 0.17, 0.99)",blurPresets={heading:{splitBy:"word",blur:3,yOffset:8,duration:700,staggerDelay:40,startDelay:0},subheading:{splitBy:"line",blur:4,yOffset:12,duration:600,staggerDelay:40,startDelay:150},button:{splitBy:"word",blur:0,yOffset:16,duration:800,staggerDelay:0,startDelay:0}};function initBlurStagger(el){var preset=el.getAttribute("data-preset")||"heading",config=blurPresets[preset]||blurPresets.heading,splitBy=el.getAttribute("data-split")||config.splitBy,blur=parseFloat(el.getAttribute("data-blur"))||config.blur,yOffset=parseFloat(el.getAttribute("data-y-offset"))||config.yOffset,duration=parseInt(el.getAttribute("data-duration"))||config.duration,staggerDelay=parseInt(el.getAttribute("data-stagger-delay"))||config.staggerDelay,startDelay=parseInt(el.getAttribute("data-start-delay"))||config.startDelay,threshold=parseFloat(el.getAttribute("data-threshold"))||.3,text="";el.childNodes.forEach(function(node){3===node.nodeType?text+=node.textContent:"BR"===node.nodeName&&(text+="\n")}),text=text.trim();var tokens=[];if("word"===splitBy)text.split("\n").forEach(function(line,lineIdx){lineIdx>0&&tokens.push("\n"),line.split(/\s+/).filter(Boolean).forEach(function(w){tokens.push(w)})});else if("character"===splitBy)tokens=text.split("");else{text.split("\n").forEach(function(part,idx){idx>0&&tokens.push("\n");var trimmed=part.trim();trimmed&&tokens.push(trimmed)}),0===tokens.length&&(tokens=[text])}el.innerHTML="";var visibleIdx=0;tokens.forEach(function(token,i){if("\n"===token)return el.appendChild(document.createTextNode(" ")),void el.appendChild(document.createElement("br"));"word"===splitBy&&i>0&&"\n"!==tokens[i-1]&&el.appendChild(document.createTextNode(" "));var span=document.createElement("span");span.textContent=token,span.style.display="inline-block",span.style.opacity="0.001",blur>0&&(span.style.filter="blur("+blur+"px)"),span.style.transform="translateY("+yOffset+"px)",span.style.transition="none",span.setAttribute("data-blur-index",visibleIdx),el.appendChild(span),visibleIdx++});observe(el,threshold,function(){var spans=el.querySelectorAll("[data-blur-index]"),transitions=["opacity "+duration+"ms "+EASING,"transform "+duration+"ms "+EASING];blur>0&&transitions.push("filter "+duration+"ms "+EASING),spans.forEach(function(span){var idx=parseInt(span.getAttribute("data-blur-index")),delay=startDelay+idx*staggerDelay,delayedTransitions=transitions.map(function(t){return t+" "+delay+"ms"});span.style.transition=delayedTransitions.join(", "),span.style.opacity="1",blur>0&&(span.style.filter="blur(0px)"),span.style.transform="translateY(0px)"})})}function initFadeUp(el){var yOffsetAttr=el.getAttribute("data-y-offset"),yOffset=null!==yOffsetAttr?parseFloat(yOffsetAttr):40,duration=parseInt(el.getAttribute("data-duration"))||1e3,threshold=parseFloat(el.getAttribute("data-threshold"))||.1,delay=parseInt(el.getAttribute("data-delay"))||0;el.style.opacity="0",el.style.transform="translateY("+yOffset+"px)",el.style.transition="none";var triggered=!1,reveal=function(){triggered||(triggered=!0,el.style.transition="opacity "+duration+"ms "+EASING+" "+delay+"ms, transform "+duration+"ms "+EASING+" "+delay+"ms",el.style.opacity="1",el.style.transform="translateY(0)")};observe(el,threshold,reveal),el.getBoundingClientRect().top<window.innerHeight&&requestAnimationFrame(reveal)}function initFadeUpStagger(el){var yOffset=parseFloat(el.getAttribute("data-y-offset"))||40,duration=parseInt(el.getAttribute("data-duration"))||1e3,staggerDelay=parseInt(el.getAttribute("data-stagger-delay"))||200,startDelay=parseInt(el.getAttribute("data-delay"))||0,threshold=parseFloat(el.getAttribute("data-threshold"))||.1,children=Array.from(el.children);children.forEach(function(child){child.style.opacity="0",child.style.transform="translateY("+yOffset+"px)",child.style.transition="none"}),observe(el,threshold,function(){children.forEach(function(child,i){var delay=startDelay+i*staggerDelay;child.style.transition="opacity "+duration+"ms "+EASING+" "+delay+"ms, transform "+duration+"ms "+EASING+" "+delay+"ms",child.style.opacity="1",child.style.transform="translateY(0)"})})}function initWaapiStagger(el){var fromY=parseFloat(el.getAttribute("data-y-offset"))||40,fromOpacity=parseFloat(el.getAttribute("data-from-opacity"))||0,duration=parseInt(el.getAttribute("data-duration"))||1e3,staggerDelay=parseInt(el.getAttribute("data-stagger-delay"))||200,startDelay=parseInt(el.getAttribute("data-delay"))||0,threshold=parseFloat(el.getAttribute("data-threshold"))||.1,children=Array.from(el.children);
1children.forEach(function(child){child.style.opacity="0",child.style.transform="translateY("+fromY+"px)"}),observe(el,threshold,function(){children.forEach(function(child,i){child.animate([{opacity:fromOpacity,transform:"translateY("+fromY+"px)"},{opacity:1,transform:"translateY(0)"}],{duration:duration,easing:EASING,delay:startDelay+i*staggerDelay,fill:"both"})})})}function initScrollLinked(el){var animStartVh=parseFloat(el.getAttribute("data-anim-start"))||1,animEndVh=parseFloat(el.getAttribute("data-anim-end"))||.4,fromOpacity=parseFloat(el.getAttribute("data-from-opacity")),toOpacity=parseFloat(el.getAttribute("data-to-opacity")),fromTx=parseFloat(el.getAttribute("data-from-translate-x")),toTx=parseFloat(el.getAttribute("data-to-translate-x"));isNaN(fromOpacity)&&(fromOpacity=.3),isNaN(toOpacity)&&(toOpacity=1),isNaN(fromTx)&&(fromTx=-80),isNaN(toTx)&&(toTx=0);var rafId=0;function onScroll(){cancelAnimationFrame(rafId),rafId=requestAnimationFrame(function(){var progress,vh=window.innerHeight,animStart=vh*animStartVh,range=animStart-vh*animEndVh,rect=el.getBoundingClientRect();rect.bottom<=0?progress=1:(progress=(animStart-rect.top)/range,progress=Math.max(0,Math.min(1,progress)));var opacity=fromOpacity+(toOpacity-fromOpacity)*progress,tx=fromTx+(toTx-fromTx)*progress;el.style.opacity=String(opacity),el.style.transform="translateX("+tx+"px)"})}onScroll(),window.addEventListener("scroll",onScroll,{passive:!0})}function initScrollLinkedGroup(el){var animStartVh=parseFloat(el.getAttribute("data-anim-start"))||1,animEndVh=parseFloat(el.getAttribute("data-anim-end"))||.4,fromOpacity=parseFloat(el.getAttribute("data-from-opacity")),toOpacity=parseFloat(el.getAttribute("data-to-opacity")),fromTx=parseFloat(el.getAttribute("data-from-translate-x")),toTx=parseFloat(el.getAttribute("data-to-translate-x"));isNaN(fromOpacity)&&(fromOpacity=.3),isNaN(toOpacity)&&(toOpacity=1),isNaN(fromTx)&&(fromTx=-80),isNaN(toTx)&&(toTx=0);var items=el.querySelectorAll("[data-scroll-item]"),indicators=document.querySelectorAll('[data-scroll-indicator="'+el.id+'"]'),activeIndex=-1,rafId=0;function onScroll(){cancelAnimationFrame(rafId),rafId=requestAnimationFrame(function(){var vh=window.innerHeight,animStart=vh*animStartVh,range=animStart-vh*animEndVh,closestDist=1/0,closestIdx=activeIndex;items.forEach(function(item,idx){var progress,rect=item.getBoundingClientRect(),center=rect.top+rect.height/2,dist=Math.abs(center-328);rect.top<vh&&rect.bottom>0&&dist<closestDist&&(closestDist=dist,closestIdx=idx),rect.bottom<=0?progress=1:(progress=(animStart-rect.top)/range,progress=Math.max(0,Math.min(1,progress)));var opacity=fromOpacity+(toOpacity-fromOpacity)*progress,tx=fromTx+(toTx-fromTx)*progress;item.style.opacity=String(opacity),item.style.transform="translateX("+tx+"px)"}),closestIdx!==activeIndex&&(activeIndex=closestIdx,indicators.forEach(function(ind,i){i===activeIndex?ind.classList.add("is-active"):ind.classList.remove("is-active")}))})}onScroll(),window.addEventListener("scroll",onScroll,{passive:!0})}function observe(el,threshold,callback){if("undefined"!=typeof IntersectionObserver){var observer=new IntersectionObserver(function(entries){entries.forEach(function(entry){entry.isIntersecting&&(callback(),observer.unobserve(el))})},{threshold:threshold});observer.observe(el)}else callback()}function init(scope){if(!window.matchMedia||!window.matchMedia("(prefers-reduced-motion: reduce)").matches){var root=scope||document;root.querySelectorAll('[data-animate="blur-stagger"]').forEach(initBlurStagger),root.querySelectorAll('[data-animate="fade-up"]').forEach(initFadeUp),root.querySelectorAll('[data-animate="fade-up-stagger"]').forEach(initFadeUpStagger),root.querySelectorAll('[data-animate="waapi-stagger"]').forEach(initWaapiStagger),root.querySelectorAll('[data-animate="scroll-linked"]').forEach(initScrollLinked),root.querySelectorAll('[data-animate="scroll-linked-group"]').forEach(initScrollLinkedGroup)}}window.initScrollAnimations=init,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",function(){init()}):init()}();
2//# sourceURL=https://6249733.fs1.hubspotusercontent-na1.net/hubfs/6249733/hub_generated/template_assets/1/210673779895/1790587011411/template_scroll-animations.js

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.