Файловый менеджер - Редактировать - /home/beautybuzzbeyond/public_html/wp-content/plugins/coblocks/dist/js/coblocks-post-carousel.js
Назад
(()=>{var e={9334:function(e){e.exports=function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,i=arguments[t];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function t(e,t){void 0===t&&(t=[]),Array.isArray(t)||(t=[t]),t.forEach((function(t){return!e.classList.contains(t)&&e.classList.add(t)}))}function n(e,t,n,i){e.addEventListener(t,n,i)}function i(e,t,n){e.removeEventListener(t,n)}function o(e,t,n){return void 0===n&&(n=""),e.setAttribute(t,n),e}function r(e,t,n){return Object.keys(t).forEach((function(n){e.style[n]=t[n]})),n&&getComputedStyle(e),e}var a={direction:"horizontal",touchRatio:1,touchAngle:45,longSwipesRatio:.5,initialSlide:0,loop:!1,freeMode:!1,passiveListeners:!0,resistance:!0,resistanceRatio:.85,speed:300,longSwipesMs:300,spaceBetween:0,slidesPerView:1,centeredSlides:!1,slidePrevClass:"swiper-slide-prev",slideNextClass:"swiper-slide-next",slideActiveClass:"swiper-slide-active",slideClass:"swiper-slide",wrapperClass:"swiper-wrapper",touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchMoveStopPropagation:!1,excludeElements:[],injections:{translate:function(e,t,n,i){r(t.element.$wrapper,{transition:e.isStart?"none":"transform ease "+i+"ms",transform:n.isHorizontal?"translate3d("+e.transforms+"px, 0, 0)":"translate3d(0, "+e.transforms+"px, 0)"})}}};var s=180/Math.PI;function l(){var t=[];return{getDuration:function(){var e=t[0],n=t[t.length-1];return e?n.time-e.time:0},getOffset:function(){var e=t[0],n=t[t.length-1];return e?{x:n.x-e.x,y:n.y-e.y}:{x:0,y:0}},getLogs:function(){return t},vector:function(){return i=(n=t).length-1,o=n[i],n=n[i-1]||o,i={x:o.x-n.x,y:o.y-n.y},o=o.time-n.time,n=i.x/o||0,o=i.y/o||0,e({},i,{angle:Math.atan2(Math.abs(i.y),Math.abs(i.x))*s,velocityX:n,velocityY:o});var n,i,o},clear:function(){t=[]},push:function(n){t.push(e({time:Date.now()},n))}}}function c(){return(performance||Date).now()}var u=requestAnimationFrame||webkitRequestAnimationFrame||setTimeout,d=cancelAnimationFrame||webkitCancelAnimationFrame||clearTimeout;function p(){var e=function(){var e,t;return{run:function(n){e=void 0===e?c():e,t=u((function(){var t=c(),i=t-e;e=t,n(i)}))},stop:function(){e=void 0,d(t)}}}();return{run:function t(n){e.run((function(e){t(n),n(e)}))},stop:function(){e.stop()}}}function f(e,t){e=e.tracker,t=t.initStatus,e.clear(),t()}function m(e,t,n,i){var o=i.initLayout,r=i.initStatus,a=i.render,s=i.scrollPixel,l=i.slideTo,c=i.getOffsetSteps,u=p();return{preheat:function(e,t){var i=n.tracker;u.stop(),i.clear(),i.push(e),o(t),r(t),n.isStart=!0,a()},move:function(t){var i,o=n.tracker,r=e.touchRatio,l=e.touchAngle,c=e.isHorizontal;n.isStart&&!n.isScrolling&&(o.push(t),i=o.vector(),((t=o.getOffset()).x||t.y)&&(c&&i.angle<l||!c&&90-i.angle<l||n.isTouching?(r=i[c?"x":"y"]*r,n.isTouching=!0,s(r),a()):(n.isScrolling=!0,o.clear())))},stop:function(){var o,r,d,p=n.index,m=n.tracker,v=t.measure;n.isStart&&(n.isStart=!1,e.freeMode?(o=m.vector()[e.isHorizontal?"velocityX":"velocityY"],u.run((function(e){e*=o,o*=.98,Math.abs(e)<.01?(u.stop(),f(n,i)):(s(e),a(0))}))):(r=m.getDuration(),d=m.getOffset()[e.isHorizontal?"x":"y"],m=Math.ceil(Math.abs(d)/v.boxSize),v=c(d),r>e.longSwipesMs?l(p+v*(0<d?-1:1)):l(0<d?p-m:p+m),f(n,i)))}}}function v(e,t){var n={};return(n.update=function(e){var i,o=function(e,t,n){var i=e.$list,o=t.viewSize,r=t.slideSize,a=t.boxSize,s=-(t=(e=(s=n).loop?Math.ceil(s.slidesPerView):0)*a)+(n.centeredSlides?(o-r)/2:0);return{max:s,min:n.spaceBetween+(n.loop?r:o)+s-a*i.length,base:s,expand:e,buffer:t,minIndex:0,maxIndex:i.length-(n.centeredSlides||n.loop?1:Math.ceil(n.slidesPerView))}}(e,(i=t,r=(o=e).$el,i={boxSize:(r=((o=i.isHorizontal?r.offsetWidth:r.offsetHeight)-Math.ceil(i.slidesPerView-1)*i.spaceBetween)/i.slidesPerView)+i.spaceBetween,viewSize:o,slideSize:r}),t),r=Boolean("ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||window.DocumentTouch&&document instanceof DocumentTouch);Object.assign(n,{touchable:r,element:e,measure:i,limitation:o})})(e),n}var x="data-shallow-slider",h="data-slider";function g(e,n){function i(){e.element.$wrapper.querySelectorAll("["+x+"]").forEach((function(t){return e.element.$wrapper.removeChild(t)}))}function a(){var t=e.element,i=e.measure,o=t.$wrapper,a={display:"flex",willChange:"transform",flexDirection:n.isHorizontal?"row":"column"},s=((t={})[n.isHorizontal?"width":"height"]=i.slideSize+"px",t[n.isHorizontal?"margin-right":"margin-bottom"]=n.spaceBetween+"px",t);r(o,a),o.querySelectorAll("["+h+"]").forEach((function(e){return r(e,s)}))}return{init:function(){(function(){var t,r,a,s,l,c;e.element.$list.forEach((function(e,t){return o(e,h,t)})),i(),n.loop&&(t=e.element,s=e.limitation,r=t.$list,a=t.$wrapper,s=s.expand,l=r.slice(-s).map((function(e){return e.cloneNode(!0)})),c=r.slice(0,s).map((function(e){return e.cloneNode(!0)})),l.forEach((function(e,t){a.appendChild(o(c[t],x)),a.insertBefore(o(l[t],x),r[0])})))})(),a()},render:function(i,o,r,a){var s=e.element.$wrapper;o=void 0===o?n.speed:o,n.injections.translate(i,e,n,o),i.isStart||function(i){var o=e.element.$wrapper,r=i.index;o.querySelectorAll("["+h+"]").forEach((function(e){var i,o,a=~~e.getAttribute(h);i=e,void 0===(o=[n.slidePrevClass,n.slideNextClass,n.slideActiveClass])&&(o=[]),Array.isArray(o)||(o=[o]),o.forEach((function(e){return i.classList.contains(e)&&i.classList.remove(e)})),a===r&&t(e,n.slideActiveClass),a==r-1&&t(e,n.slidePrevClass),a===r+1&&t(e,n.slideNextClass)}))}(i),a&&getComputedStyle(s).transform,r&&setTimeout(r,o)},destroy:function(){var t=e.element,o=t.$list,r=t.$wrapper,a=n.isHorizontal?"margin-right":"margin-bottom";["display","will-change","flex-direction"].forEach((function(e){r.style.removeProperty(e)})),o.forEach((function(e){return e.style.removeProperty(a)})),i()},updateSize:a}}function b(e,t){var n=e-t.max;return t=e-t.min,0<n?n:t<0?t:0}function y(t,n,i,o,r){function a(e){var n=t.measure;return Math.ceil(Math.abs(e)/n.boxSize-i.longSwipesRatio)}function s(e,t,i){o.render(n,e,t,i)}function l(o){var a,s,l=(s=t.limitation).min,c=s.max;l=(s=c-l+(i.loop?t.measure.boxSize:0))+1,n.transforms=o,i.loop?(a=(c-o)%l/s,n.progress=a<0?1+a:1<a?a-1:a):(a=(c-o)/s,n.progress=a<0?0:1<a?1:a),r.emit("scroll",e({},n))}function c(e,o){var c,u,d,p,f,m=t.measure,v=t.limitation,x=v.maxIndex-v.minIndex+1,h=i.loop?(e%x+x)%x:e>v.maxIndex?v.maxIndex:e<v.minIndex?v.minIndex:e,g=-h*m.boxSize+v.base;0!==a(g-n.transforms)&&i.loop&&(c=b(n.transforms,v),u=h-n.index,d=n.index,p=h,f=u,e=(x=v).maxIndex,d=(0<f?1:-1)*(x.minIndex-e-1)+p-d,(f=Math.abs(f)>Math.abs(d)?d:f)===u||c?n.index===h&&l(0<c?v.min-m.boxSize+c:v.max+m.boxSize+c):l(f<0?v.min-m.boxSize:v.max+m.boxSize),s(0,void 0,!0)),r.emit("before-slide",n.index,n,h),n.index=h,l(g),s(o,(function(){r.emit("after-slide",h,n)}))}return{update:function(){c(n.index,0),o.updateSize()},render:s,transform:l,slideTo:c,scrollPixel:function(e){var o,r=n.transforms,a=t.measure,s=t.limitation,c=(o=Number(e.toExponential().split("e")[1]))<=0?Math.pow(10,-(o-1)):1,u=r;i.resistance&&!i.loop&&(0<e&&r>=s.max?e-=Math.pow(e*c,i.resistanceRatio)/c:e<0&&r<=s.min&&(e+=Math.pow(-e*c,i.resistanceRatio)/c)),u+=e,i.loop&&(o=n.tracker.vector(),c=i.isHorizontal?o.velocityX:o.velocityY,(e=b(r,s))&&(o=r,r=s,0<c&&o>r.max||c<0&&o<r.min)&&(u=0<e?s.min-a.boxSize+e:s.max+a.boxSize+e)),l(u)},initStatus:function(e){void 0===e&&(e=0),n.startTransform=e,n.isStart=!1,n.isScrolling=!1,n.isTouching=!1},initLayout:function(e){l(e)},getOffsetSteps:a}}function S(e,t){var n="string"==typeof e?document.body.querySelector(e):e;return e=n.querySelector("."+t.wrapperClass),t=[].slice.call(n.getElementsByClassName(t.slideClass)),{$el:n,$wrapper:e,$list:t=t.filter((function(e){return null===e.getAttribute("data-shallow-slider")}))}}function w(t,o){var r=(d=e({},a,d=o),e({},d,{isHorizontal:"horizontal"===d.direction})),s=function(){var e={};return{on:function(t,n){e[t]?e[t].push(n):e[t]=[n]},off:function(t,n){!e[t]||-1<(n=e[t].indexOf(n))&&e[t].splice(n,1)},emit:function(t){for(var n=arguments.length,i=new Array(1<n?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];e[t]&&e[t].forEach((function(e){return e.apply(void 0,i)}))},clear:function(){e={}}}}(),c=v(S(t,r),r),u={tracker:l(),index:0,startTransform:0,isStart:!1,isScrolling:!1,isTouching:!1,transforms:0,progress:0},d=(o=s.on,s.off),p=s.emit,f={on:o,off:d,env:c,state:u,options:r};(r.plugins||w.plugins||[]).forEach((function(e){return e(f,r)})),p("before-init",f);var x=g(c,r),h=y(c,u,r,x,s),b=function(e,t,o,r){var a=e.touchable,s=["INPUT","SELECT","OPTION","TEXTAREA","BUTTON","VIDEO"],l=(r=m(o,e,t,r)).preheat,c=r.move,u=r.stop;function d(e){return{x:(e=a?e.changedTouches[0]:e).pageX,y:e.pageY}}function p(t){for(var n=0;n<o.excludeElements.length;n++)if(o.excludeElements[n].contains(t.target))return;var i,r=e.element.$wrapper,c=o.touchStartPreventDefault&&-1===s.indexOf(t.target.nodeName)||o.touchStartForcePreventDefault;!a&&c&&t.preventDefault(),l(d(t),(i=r,c=o.isHorizontal,r=getComputedStyle(i).transform.replace(/[a-z]|\(|\)|\s/g,"").split(",").map(parseFloat),i=[],16===r.length?i=r.slice(12,14):6===r.length&&(i=r.slice(4,6)),i[c?0:1]||0))}function f(e){o.touchMoveStopPropagation&&e.stopPropagation(),c(d(e)),t.isTouching&&!1!==e.cancelable&&e.preventDefault()}function v(){u()}return{attach:function(){var t=e.element.$el;a?(n(t,"touchstart",p,{passive:o.passiveListeners,capture:!1}),n(t,"touchmove",f),n(t,"touchend",v),n(t,"touchcancel",v)):(n(t,"mousedown",p),n(document,"mousemove",f),n(document,"mouseup",v))},detach:function(){var t=e.element.$el;i(t,"touchstart",p),i(t,"touchmove",f),i(t,"touchend",v),i(t,"touchcancel",v),i(t,"mousedown",p),i(document,"mousemove",f),i(document,"mouseup",v)}}}(c,u,r,h);return u=h.slideTo,Object.assign(f,{update:function(){x.destroy(),c.update(S(t,r)),x.init(),h.update()},destroy:function(){p("before-destroy",f),b.detach(),x.destroy(),p("after-destroy",f),s.clear()},slideTo:u,updateSize:function(){c.update(S(t,r)),h.update()}}),x.init(),b.attach(),u(r.initialSlide,0),p("after-init",f),f}return w.use=function(e){w.plugins=e},w}()},8608:function(e){e.exports=function(){"use strict";function e(e,t,n,i){e.addEventListener(t,n,i)}function t(e,t,n){e.removeEventListener(t,n)}return function(n,i){function o(e){c(e.target,"next")}function r(e){c(e.target,"prev")}var a=Boolean(i.navigation),s={nextEl:null,prevEl:null},l=Object.assign({disabledClass:"swiper-button-disabled"},i.navigation),c=function(e,t){u(e)&&!n.options.loop||(e=n.state.index,"next"===t&&n.slideTo(e+1),"prev"===t&&n.slideTo(e-1))},u=function(e){return e.classList.contains(l.disabledClass)};n.on("before-slide",(function(e,t,i){var o,r;n.options.loop||(o=i,i=(r=n.env.limitation).minIndex,r=r.maxIndex,s&&s.prevEl&&s.nextEl&&(s.nextEl.classList.contains(l.disabledClass)&&i<=o&&s.nextEl.classList.remove(l.disabledClass),s.prevEl.classList.contains(l.disabledClass)&&o<=r&&s.prevEl.classList.remove(l.disabledClass),o===i&&s.prevEl.classList.add(l.disabledClass),o===r&&s.nextEl.classList.add(l.disabledClass)))})),n.on("after-init",(function(){var t,i,c;a&&(s.nextEl="string"==typeof l.nextEl?document.body.querySelector(l.nextEl):l.nextEl,s.prevEl="string"==typeof l.prevEl?document.body.querySelector(l.prevEl):l.prevEl,n.options.loop||(t=n.state.index,i=n.env.element.$list,t===(c=n.env.limitation.minIndex)&&s.prevEl&&s.prevEl.classList.add(l.disabledClass),i.length===c&&s.nextEl&&s.nextEl.classList.add(l.disabledClass)),e(s.nextEl,"click",o),e(s.prevEl,"click",r))})),n.on("after-destroy",(function(){s&&s.prevEl&&s.nextEl&&(t(s.nextEl,"click",o),t(s.prevEl,"click",r),delete s.nextEl,delete s.prevEl)}))}}()}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i].call(r.exports,r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(9334),t=n.n(e),i=n(8608),o=n.n(i);document.addEventListener("DOMContentLoaded",(function(){setTimeout((()=>{const e=document.querySelectorAll(".wp-block-coblocks-post-carousel");for(let i=0;i<e.length;i++){const r=e[i];if(r){var n;const e=r.querySelector("[data-swiper]"),i=JSON.parse(null==e||null===(n=e.dataset)||void 0===n?void 0:n.swiper),a=r.querySelector("#wp-coblocks-post-carousel-swiper-prev"),s=r.querySelector("#wp-coblocks-post-carousel-swiper-next");a.setAttribute("aria-label",coblocksPostCarousel.carouselPrevButtonAriaLabel),s.setAttribute("aria-label",coblocksPostCarousel.carouselNextButtonAriaLabel),r.querySelectorAll(".swiper-slide").length>1&&(a.style.visibility="visible",s.style.visibility="visible",new(t())(e,{centeredSlides:!1,loop:!0,navigation:{nextEl:s,prevEl:a},plugins:[o()],slidesPerView:i.slidesToShow,spaceBetween:35,touchable:!1}))}}}),1500)}))})()})();
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка