PageSourceSearch

https://www.formacioncontinua.eu/cdn/shop/t/3/assets/universal-animations.js?v=127529707426021432281766540836

js formacioncontinua.eu collected 2026-10-06 01:15:30 UTC 6,019 bytes, 2 lines download raw bytes

1const ANIMATION_CONFIG={DEFAULT_WRAPPER_CLASS:"animate__animated",DEFAULT_TRIGGER_MARGIN:"0px 0px -10% 0px",DEFAULT_THRESHOLD:.1,CASCADE_DELAY_MULTIPLIER:100,FALLBACK_DELAY:100},CSS_CLASSES={SCROLL_TRIGGER:"scroll-trigger",SCROLL_OFFSCREEN:"scroll-trigger--offscreen",SCROLL_CANCEL:"scroll-trigger--cancel",DESIGN_MODE:"scroll-trigger--design-mode",ANIMATED:"animate__animated",TEXT_ANIMATED:"text-animate"},HTML_ENTITIES_REGEX=/ |&|<|>|"|'|//g,AnimationUtils={cleanClassName(className){return className.replace(HTML_ENTITIES_REGEX,"").trim()},safeRemoveClass(element,className){try{const cleanClassName=this.cleanClassName(className);cleanClassName&&element.classList.contains(cleanClassName)&&element.classList.remove(cleanClassName)}catch(error){console.warn("Failed to remove class:",className,error)}},getAnimationClass(element){const animationClass=element.className.split(" ").find(cls=>{const cleanClass=this.cleanClassName(cls);return cleanClass.startsWith("animate__")&&cleanClass!==CSS_CLASSES.ANIMATED});return animationClass?this.cleanClassName(animationClass):"animate__fadeIn"},prefersReducedMotion(){return window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},supportsIntersectionObserver(){return"IntersectionObserver"in window}};class UniversalAnimations{constructor(options={}){this.config={wrapperClass:options.wrapperClass||ANIMATION_CONFIG.DEFAULT_WRAPPER_CLASS,sectionId:options.sectionId||"",blockId:options.blockId||"",triggerMargin:options.triggerMargin||ANIMATION_CONFIG.DEFAULT_TRIGGER_MARGIN},this.state={animatedElements:new Set,elementAnimations:new Map,observer:null},this.init()}init(){if(AnimationUtils.prefersReducedMotion()){this.handleReducedMotion();return}if(!AnimationUtils.supportsIntersectionObserver()){this.animateAllElements();return}this.createObserver(),this.observeElements()}createObserver(){this.state.observer=new IntersectionObserver(entries=>this.onIntersection(entries),{root:null,rootMargin:this.config.triggerMargin,threshold:ANIMATION_CONFIG.DEFAULT_THRESHOLD})}onIntersection(entries){entries.forEach((entry,index)=>{const element=entry.target;entry.isIntersecting?this.handleElementEntering(element,index):this.handleElementLeaving(element)})}handleElementEntering(element,index){element.classList.contains(CSS_CLASSES.SCROLL_OFFSCREEN)&&(element.classList.remove(CSS_CLASSES.SCROLL_OFFSCREEN),element.hasAttribute("data-cascade")&&element.setAttribute("style",`--animation-order: ${index};`),this.animateElement(element)),this.state.observer.unobserve(element)}handleElementLeaving(element){element.classList.add(CSS_CLASSES.SCROLL_OFFSCREEN),element.classList.remove(CSS_CLASSES.SCROLL_CANCEL)}handleReducedMotion(){this.getElements().forEach(element=>{element.style.opacity="1",element.style.visibility="visible",element.classList.add(CSS_CLASSES.DESIGN_MODE)})}getElements(){let selector;return this.config.blockId?selector=`.${this.config.wrapperClass}-${this.config.blockId}`:this.config.sectionId?selector=`.${this.config.wrapperClass}-${this.config.sectionId}`:selector=`.${this.config.wrapperClass}`,document.querySelectorAll(selector)}observeElements(){this.getElements().forEach(element=>{this.shouldAnimateElement(element)&&(this.prepareElement(element),this.state.observer.observe(element))})}shouldAnimateElement(element){return element.classList.contains(CSS_CLASSES.ANIMATED)}prepareElement(element){const originalAnimationClass=AnimationUtils.getAnimationClass(element);if(this.state.elementAnimations.set(element,originalAnimationClass),element.classList.contains(CSS_CLASSES.TEXT_ANIMATED))return"";element.classList.add(CSS_CLASSES.SCROLL_TRIGGER,CSS_CLASSES.SCROLL_OFFSCREEN),AnimationUtils.safeRemoveClass(element,CSS_CLASSES.ANIMATED),originalAnimationClass&&originalAnimationClass!=="animate__fadeIn"&&AnimationUtils.safeRemoveClass(element,originalAnimationClass)}animateElement(element){if(this.state.animatedElements.has(element))return;this.state.animatedElements.add(element);const animationClass=this.state.elementAnimations.get(element)||"animate__fadeIn";requestAnimationFrame(()=>{element.classList.add(CSS_CLASSES.ANIMATED,animationClass)})}
1animateAllElements(){this.getElements().forEach((element,index)=>{if(this.shouldAnimateElement(element)){const animationClass=this.state.elementAnimations.get(element)||"animate__fadeIn";setTimeout(()=>{requestAnimationFrame(()=>{element.classList.add(CSS_CLASSES.ANIMATED,animationClass)})},index*ANIMATION_CONFIG.FALLBACK_DELAY)}})}reset(){this.state.animatedElements.clear(),this.state.elementAnimations.clear(),this.state.observer&&this.state.observer.disconnect(),this.init()}triggerAnimation(elementId){const element=document.getElementById(elementId);element&&!this.state.animatedElements.has(element)&&this.animateElement(element)}}function initializeAnimations(){document.querySelectorAll("script[data-wrapper-class]").forEach(script=>{const options={wrapperClass:script.dataset.wrapperClass,sectionId:script.dataset.sectionId,blockId:script.dataset.blockId,triggerMargin:script.dataset.triggerMargin};new UniversalAnimations(options)})}function handleShopifyDesignMode(){typeof Shopify>"u"||!Shopify.designMode||(document.addEventListener("shopify:section:load",event=>{event.target.querySelectorAll("script[data-wrapper-class]").forEach(script=>{const options={wrapperClass:script.dataset.wrapperClass,sectionId:script.dataset.sectionId,blockId:script.dataset.blockId,triggerMargin:script.dataset.triggerMargin};new UniversalAnimations(options)})}),document.addEventListener("shopify:section:reorder",initializeAnimations))}function initializeOnDOMReady(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initializeAnimations):initializeAnimations()}initializeOnDOMReady(),handleShopifyDesignMode(),window.UniversalAnimations=UniversalAnimations,window.AnimationUtils=AnimationUtils;
2//# sourceMappingURL=/cdn/shop/t/3/assets/universal-animations.js.map?v=127529707426021432281766540836

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.