All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.modules.effect-cards.min.mjs Maven / Gradle / Ivy

Go to download

Most modern mobile touch slider and framework with hardware accelerated transitions

There is a newer version: 11.1.14
Show newest version
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{e as effectVirtualTransitionEnd}from"../shared/effect-virtual-transition-end.min.mjs";import{g as getSlideTransformEl}from"../shared/utils.min.mjs";function EffectCards(e){let{swiper:t,extendParams:a,on:s}=e;a({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}});effectInit({effect:"cards",swiper:t,on:s,setTranslate:()=>{const{slides:e,activeIndex:a,rtlTranslate:s}=t,r=t.params.cardsEffect,{startTranslate:i,isTouched:n}=t.touchEventsData,o=s?-t.translate:t.translate;for(let l=0;l0&&c<1&&(n||t.params.cssMode)&&o-1&&(n||t.params.cssMode)&&o>i;if(E||T){const e=(1-Math.abs((Math.abs(c)-.5)/.5))**.5;w+=-28*c*e,u+=-.5*e,S+=96*e,h=-25*e*Math.abs(c)+"%"}if(p=c<0?`calc(${p}px ${s?"-":"+"} (${S*Math.abs(c)}%))`:c>0?`calc(${p}px ${s?"-":"+"} (-${S*Math.abs(c)}%))`:`${p}px`,!t.isHorizontal()){const e=h;h=p,p=e}const g=c<0?""+(1+(1-u)*c):""+(1-(1-u)*c),x=`\n        translate3d(${p}, ${h}, ${M}px)\n        rotateZ(${r.rotate?s?-w:w:0}deg)\n        scale(${g})\n      `;if(r.slideShadows){let e=d.querySelector(".swiper-slide-shadow");e||(e=createShadow("cards",d)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(c)-.5)/.5,0),1))}d.style.zIndex=-Math.abs(Math.round(f))+e.length;effectTarget(r,d).style.transform=x}},setTransition:e=>{const a=t.slides.map((e=>getSlideTransformEl(e)));a.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),effectVirtualTransitionEnd({swiper:t,duration:e,transformElements:a})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}export{EffectCards as default};
//# sourceMappingURL=effect-cards.min.mjs.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy