UNPKG

taggedjs-animate-css

Version:

HTML and CSS animations for TaggedJs brought to us by animate-css

2 lines 2.8 kB
var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{qG:()=>x,Ce:()=>d,tE:()=>r,Xn:()=>c,rf:()=>u,MV:()=>l,fx:()=>m,WT:()=>y});var n={};function o({fxIn:t,fxOut:e,outPositionAbsolute:n=!0}){return{in:(e,n)=>a({fxName:t,...e},n),out:(t,o)=>i({fxName:e,outPositionAbsolute:n,...t},o)}}t.r(n),t.d(n,{qG:()=>x,Ce:()=>d,tE:()=>r,Xn:()=>c,rf:()=>u,MV:()=>l,fx:()=>m,WT:()=>y});const a=async({target:t,fxName:e="fadeInUp"},n)=>(t.style.opacity="0",n&&await f(n),t.style.opacity="1",s(e,t)),i=async({target:t,outPositionAbsolute:e=!0,fxName:n="fadeOutUp"},o)=>(e&&function(t){t.style.zIndex=t.style.zIndex||1;const e=t.offsetTop+"px",n=t.offsetLeft+"px",o=t.clientWidth+(t.offsetWidth-t.clientWidth)+1+"px",a=t.clientHeight+(t.offsetHeight-t.clientHeight)+1+"px";setTimeout((()=>{t.style.top=e,t.style.left=n,t.style.width=o,t.style.height=a,t.style.position="absolute"}),0)}(t),o&&await f(o),s(n,t));function s(t,e){let n;const o=new Promise((function(t){n=t}));return e.classList.add("animate__animated","animate__"+t),e.addEventListener("animationend",(function o(a){a.target===e&&(e.classList.remove("animate__animated","animate__"+t),e.removeEventListener("animationend",o),n(void 0))})),o}function f(t){return new Promise((e=>{setTimeout(e,t)}))}const{in:r,out:u}=o({fxIn:"fadeInUp",fxOut:"fadeOutDown"}),{in:d,out:l}=o({fxIn:"fadeInDown",fxOut:"fadeOutUp"}),{in:x,out:c}=o({fxIn:"fadeIn",fxOut:"fadeOut"}),y=({stagger:t=100,fxIn:e,fxOut:n,duration:o="2s",inName:a="fadeInUp",outName:i="fadeOutDown",outPositionAbsolute:s=!1}={})=>{let f=0;const r=p((function(e){e.style.setProperty("--animate-duration",o);const n=t*f++;return r.fxIn({target:e},n).then((()=>{--f}))}),(function(e){e.style.setProperty("--animate-duration",o);const n=t*f++;return r.fxOut({target:e},n).then((()=>{--f}))}),e,n,a,i,s);return r.host},m=({fxIn:t,fxOut:e,stagger:n,inName:o="fadeInUp",outName:a="fadeOutDown",duration:i=".2s",outPositionAbsolute:s=!1}={})=>{const f=p((t=>(t.style.setProperty("--animate-duration",i),f.fxIn({target:t},n))),(t=>{t.style.setProperty("--animate-duration",i);return f.fxOut({target:t},n)}),t,e,o,a,s);return f.host};function p(t,e,a,i,s,f,r){if(!a||!i){const t=o({fxIn:s,fxOut:f,outPositionAbsolute:r});a||(a=t.in),i||(i=t.out)}return{fxIn:a,fxOut:i,host:(0,n.host)((()=>{}),{onInit:t,onDestroy:e})}}var O=e.qG,I=e.Ce,g=e.tE,h=e.Xn,P=e.rf,b=e.MV,w=e.fx,v=e.WT;export{O as fadeIn,I as fadeInDown,g as fadeInUp,h as fadeOut,P as fadeOutDown,b as fadeOutUp,w as fx,v as fxGroup}; //# sourceMappingURL=bundle.js.map