Files
ntspi-app/public/build/assets/ClientImageSlider-CvtLuRx_.js
T
2024-10-04 16:05:23 +05:00

2 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{F as g}from"./v3-DnjJww8i.js";import{_ as m}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as h,o as l,c as i,b as s,F as c,d as f,n as x,t as p,a as b}from"./app-CBssobj-.js";const _={name:"ClientImageSlider",components:{FsLightbox:g},data(){return{currentIndex:0,items:this.block.data.url,toggler:!1,domainPath:null,slide:null}},props:{block:{type:Array}},methods:{prevSlide(){this.currentIndex===0?this.currentIndex=this.items.length-1:this.currentIndex--},nextSlide(){this.currentIndex===this.items.length-1?this.currentIndex=0:this.currentIndex++},openLightboxOnSlide:function(a){this.slide=a,this.toggler=!this.toggler}},mounted(){this.domainPath=window.location.origin}},v={class:"relative"},k={class:"flex"},I=["onClick","src"],S={class:"mt-3 text-sm text-center text-gray-500 dark:text-neutral-500"};function y(a,n,d,C,e,o){const u=h("FsLightbox");return l(),i(c,null,[s("div",v,[s("div",k,[(l(!0),i(c,null,f(e.items,(t,r)=>(l(),i("div",{key:r,class:x(["w-full",{block:e.currentIndex===r,hidden:e.currentIndex!==r}])},[s("img",{onClick:w=>o.openLightboxOnSlide(r+1),src:"/storage/"+t,class:"mx-auto max-h-[500px] object-cover rounded-md hover:opacity-95 hover:duration-200 transition"},null,8,I)],2))),128))]),s("button",{class:"absolute top-1/2 left-4 transform -translate-y-1/2 bg-white rounded-full p-2 shadow-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:n[0]||(n[0]=(...t)=>o.prevSlide&&o.prevSlide(...t))}," "),s("button",{class:"absolute top-1/2 right-4 transform -translate-y-1/2 bg-white rounded-full p-2 shadow-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",onClick:n[1]||(n[1]=(...t)=>o.nextSlide&&o.nextSlide(...t))}," ")]),s("figcaption",S,p(d.block.data.alt),1),b(u,{class:"",slide:e.slide,toggler:e.toggler,sources:e.items.map(t=>e.domainPath+"/storage/"+t)},null,8,["slide","toggler","sources"])],64)}const P=m(_,[["render",y]]);export{P as default};