PageSourceSearch

https://surecart.com/wp-content/plugins/spectra-pro/spectra-pro-v2…/slider/effects.js?ver=3.0.0-beta.2

js surecart.com collected 2026-09-24 17:09:36 UTC 10,554 bytes, 1 lines download raw bytes

vendor: 9,562 bytes, line 1
1(()=>{"use strict";function e(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function s(e,s){void 0===s&&(s=[]);const t=document.createElement(e);return t.classList.add(...Array.isArray(s)?s:function(e){return void 0===e&&(e=""),e.trim().split(" ").filter((e=>!!e.trim()))}(s)),t}function t(e){return s=>Math.abs(s)>0&&e.browser&&e.browser.need3dFix&&Math.abs(s)%90==0?s+.001:s}function r(e){const{effect:s,swiper:t,on:r,setTranslate:a,setTransition:i,overwriteParams:o,perspective:l,recreateShadows:n,getEffectParams:d}=e;let c;r("beforeInit",(()=>{if(t.params.effect!==s)return;t.classNames.push(`${t.params.containerModifierClass}${s}`),l&&l()&&t.classNames.push(`${t.params.containerModifierClass}3d`);const e=o?o():{};Object.assign(t.params,e),Object.assign(t.originalParams,e)})),r("setTranslate",(()=>{t.params.effect===s&&a()})),r("setTransition",((e,r)=>{t.params.effect===s&&i(r)})),r("transitionEnd",(()=>{if(t.params.effect===s&&n){if(!d||!d().slideShadows)return;t.slides.forEach((e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>e.remove()))})),n()}})),r("virtualUpdate",(()=>{t.params.effect===s&&(t.slides.length||(c=!0),requestAnimationFrame((()=>{c&&t.slides&&t.slides.length&&(a(),c=!1)})))}))}function a(s,t){const r=e(t);return r!==t&&(r.style.backfaceVisibility="hidden",r.style["-webkit-backface-visibility"]="hidden"),r}function i(e){let{swiper:s,duration:t,transformElements:r,allSlides:a}=e;const{activeIndex:i}=s;if(s.params.virtualTranslate&&0!==t){let e,t=!1;e=a?r:r.filter((e=>{const t=e.classList.contains("swiper-slide-transform")?(e=>e.parentElement?e.parentElement:s.slides.find((s=>s.shadowRoot&&s.shadowRoot===e.parentNode)))(e):e;return s.getSlideIndex(t)===i})),e.forEach((e=>{!function(e,s){s&&e.addEventListener("transitionend",(function t(r){r.target===e&&(s.call(e,r),e.removeEventListener("transitionend",t))}))}(e,(()=>{if(t)return;if(!s||s.destroyed)return;t=!0,s.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});s.wrapperEl.dispatchEvent(e)}))}))}}function o(t,r,a){const i=`swiper-slide-shadow${a?`-${a}`:""}${t?` swiper-slide-shadow-${t}`:""}`,o=e(r);let l=o.querySelector(`.${i.split(" ").join(".")}`);return l||(l=s("div",i.split(" ")),o.append(l)),l}const l=window.wp.hooks,n={cube:function(e){let{swiper:a,extendParams:i,on:o}=e;i({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const l=(e,t,r)=>{let a=r?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),i=r?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=s("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(r?"left":"top")).split(" ")),e.append(a)),i||(i=s("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(r?"right":"bottom")).split(" ")),e.append(i)),a&&(a.style.opacity=Math.max(-t,0)),i&&(i.style.opacity=Math.max(t,0))};r({effect:"cube",swiper:a,on:o,setTranslate:()=>{const{el:e,wrapperEl:r,slides:i,width:o,height:n,rtlTranslate:d,size:c,browser:p}=a,f=t(a),w=a.params.cubeEffect,h=a.isHorizontal(),m=a.virtual&&a.params.virtual.enabled;let u,b=0;w.shadow&&(h?(u=a.wrapperEl.querySelector(".swiper-cube-shadow"),u||(u=s("div","swiper-cube-shadow"),a.wrapperEl.append(u)),u.style.height=`${o}px`):(u=e.querySelector(".swiper-cube-shadow"),u||(u=s("div","swiper-cube-shadow"),e.append(u))));for(let e=0;e<i.length;e+=1){const s=i[e];let t=e;m&&(t=parseInt(s.getAttribute("data-swiper-slide-index"),10));let r=90*t,a=Math.floor(r/360);d&&(r=-r,a=Math.floor(-r/360));const o=Math.max(Math.min(s.progress,1),-1);let n=0,p=0,u=0;t%4==0?(n=4*-a*c,u=0):(t-1)%4==0?(n=0,u=4*-a*c):(t-2)%4==0?(n=c+4*a*c,u=c):(t-3)%4==0&&(n=-c,u=3*c+4*c*a),d&&(n=-n),h||(p=n,n=0);const y=`rotateX(${f(h?0:-r)}deg) rotateY(${f(h?r:0)}deg) translate3d(${n}px, ${p}px, ${u}px)`;o<=1&&o>-1&&(b=90*t+90*o,d&&(b=90*-t-90*o)),s.style.transform=y,w.slideShadows&&l(s,o,h)}if(r.style.transformOrigin=`50% 50% -${c/2}px`,r.style["-webkit-transform-origin"]=`50% 50% -${c/2}px`,w.shadow)if(h)u.style.transform=`translate3d(0px, ${o/2+w.shadowOffset}px, ${-o/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${w.shadowScale})`;else{const e=Math.abs(b)-90*Math.floor(Math.abs(b)/90),s=1.5-(Math.sin(2*e*Math.PI/360)/2+Math.cos(2*e*Math.PI/360)/2),t=w.shadowScale,r=w.shadowScale/s,a=w.shadowOffset;u.style.transform=`scale3d(${t}, 1, ${r}) translate3d(0px, ${n/2+a}px, ${-n/2/r}px) rotateX(-89.99deg)`}const y=(p.isSafari||p.isWebView)&&p.needPerspectiveFix?-c/2:0;r.style.transform=`translate3d(0px,0,${y}px) rotateX(${f(a.isHorizontal()?0:b)}deg) rotateY(${f(a.isHorizontal()?-b:0)}deg)`,r.style.setProperty("--swiper-cube-translate-z",`${y}px`)},setTransition:e=>{const{el:s,slides:t}=a;if(t.forEach((s=>{s.style.transitionDuration=`${e}ms`,s.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((s=>{s.style.transitionDuration=`${e}ms`}))})),a.params.cubeEffect.shadow&&!a.isHorizontal()){const t=s.querySelector(".swiper-cube-shadow");t&&(t.style.transitionDuration=`${e}ms`)}},recreateShadows:()=>{const e=a.isHorizontal();a.slides.forEach((s=>{const t=Math.max(Math.min(s.progress,1),-1);l(s,t,e)}))},getEffectParams:()=>a.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})},coverflow:function(s){let{swiper:i,extendParams:l,on:n}=s;l({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),r({effect:"coverflow",swiper:i,on:n,setTranslate:()=>{const{width:e,height:s,slides:r,slidesSizesGrid:l}=i,n=i.params.coverflowEffect,d=i.isHorizontal(),c=i.translate,p=d?e/2-c:s/2-c,f=d?n.rotate:-n.rotate,w=n.depth,h=t(i);for(let e=0,s=r.length;e<s;e+=1){const s=r[e],t=l[e],i=(p-s.swiperSlideOffset-t/2)/t,c="function"==typeof n.modifier?n.modifier(i):i*n.modifier;let m=d?f*c:0,u=d?0:f*c,b=-w*Math.abs(c),y=n.stretch;"string"==typeof y&&-1!==y.indexOf("%")&&(y=parseFloat(n.stretch)/100*t);let g=d?0:y*c,S=d?y*c:0,E=1-(1-n.scale)*Math.abs(c);Math.abs(S)<.001&&(S=0),Math.abs(g)<.001&&(g=0),Math.abs(b)<.001&&(b=0),Math.abs(m)<.001&&(m=0),Math.abs(u)<.001&&(u=0),Math.abs(E)<.001&&(E=0);const $=`translate3d(${S}px,${g}px,${b}px)  rotateX(${h(u)}deg) rotateY(${h(m)}deg) scale(${E})`;if(a(0,s).style.transform=$,s.style.zIndex=1-Math.abs(Math.round(c)),n.slideShadows){let e=d?s.querySelector(".swiper-slide-shadow-left"):s.querySelector(".swiper-slide-shadow-top"),t=d?s.querySelector(".swiper-slide-shadow-right"):s.querySelector(".swiper-slide-shadow-bottom");e||(e=o("coverflow",s,d?"left":"top")),t||(t=o("coverflow",s,d?"right":"bottom")),e&&(e.style.opacity=c>0?c:0),t&&(t.style.opacity=-c>0?-c:0)}}},setTransition:s=>{i.slides.map((s=>e(s))).forEach((e=>{e.style.transitionDuration=`${s}ms`,e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>{e.style.transitionDuration=`${s}ms`}))}))},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})},fade:function(s){let{swiper:t,extendParams:o,on:l}=s;o({fadeEffect:{crossFade:!1}}),r({effect:"fade",swiper:t,on:l,setTranslate:()=>{const{slides:e}=t;t.params.fadeEffect;for(let s=0;s<e.length;s+=1){const e=t.slides[s];let r=-e.swiperSlideOffset;t.params.virtualTranslate||(r-=t.translate);let i=0;t.isHorizontal()||(i=r,r=0);const o=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),l=a(0,e);l.style.opacity=o,l.style.transform=`translate3d(${r}px, ${i}px, 0px)`}},setTransition:s=>{const r=t.slides.map((s=>e(s)));r.forEach((e=>{e.style.transitionDuration=`${s}ms`})),i({swiper:t,duration:s,transformElements:r,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},flip:function(s){let{swiper:l,extendParams:n,on:d}=s;n({flipEffect:{slideShadows:!0,limitRotation:!0}});const c=(e,s)=>{let t=l.isHorizontal()?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),r=l.isHorizontal()?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");t||(t=o("flip",e,l.isHorizontal()?"left":"top")),r||(r=o("flip",e,l.isHorizontal()?"right":"bottom")),t&&(t.style.opacity=Math.max(-s,0)),r&&(r.style.opacity=Math.max(s,0))};r({effect:"flip",swiper:l,on:d,setTranslate:()=>{const{slides:e,rtlTranslate:s}=l,r=l.params.flipEffect,i=t(l);for(let t=0;t<e.length;t+=1){const o=e[t];let n=o.progress;l.params.flipEffect.limitRotation&&(n=Math.max(Math.min(o.progress,1),-1));const d=o.swiperSlideOffset;let p=-180*n,f=0,w=l.params.cssMode?-d-l.translate:-d,h=0;l.isHorizontal()?s&&(p=-p):(h=w,w=0,f=-p,p=0),o.style.zIndex=-Math.abs(Math.round(n))+e.length,r.slideShadows&&c(o,n);const m=`translate3d(${w}px, ${h}px, 0px) rotateX(${i(f)}deg) rotateY(${i(p)}deg)`;a(0,o).style.transform=m}},setTransition:s=>{const t=l.slides.map((s=>e(s)));t.forEach((e=>{e.style.transitionDuration=`${s}ms`,e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>{e.style.transitionDuration=`${s}ms`}))})),i({swiper:l,duration:s,transformElements:t})},recreateShadows:()=>
1{l.params.flipEffect,l.slides.forEach((e=>{let s=e.progress;l.params.flipEffect.limitRotation&&(s=Math.max(Math.min(e.progress,1),-1)),c(e,s)}))},getEffectParams:()=>l.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!l.params.cssMode})})}};(0,l.addFilter)("spectra.sliderModules","spectra-pro/slider/modules",((e,s)=>{const t=s?.effect;return t&&n[t]&&e.push(n[t]),e})),(0,l.addFilter)("spectra.sliderParams","spectra-pro/slider/params",(e=>{const s=e?.effect;if(!s||!n[s])return e;switch(s){case"cube":e.cubeEffect={slideShadows:!0};break;case"coverflow":e.coverflowEffect={rotate:50,stretch:0,depth:100,modifier:1},e.centeredSlides=!0;break;case"flip":e.flipEffect={limitRotation:!0};break;case"fade":e.fadeEffect={crossFade:!0}}return["cube","flip","fade"].includes(s)&&(e.slidesPerView=1,e.breakpoints&&Object.keys(e.breakpoints).forEach((s=>{e.breakpoints[s].slidesPerView=1}))),e}))})();

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.