import{_ as D}from"./AuthenticatedLayout-B1Mw0bSH.js";import{q as d,z as T,H as z,f as r,o as u,a as w,w as h,b as t,u as E,m as I,G as X,F as v,k as x,n as S,t as g}from"./app-B2Zwqohx.js";import{_ as B}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-DvF1_A1S.js";import"./DropdownLink-3EyKePJC.js";const L={class:"relative w-full max-w-3xl mx-auto overflow-hidden group carousel-wrapper"},M=["src","alt"],P={class:"p-4 bg-white text-center slide-info"},$={class:"text-xl font-semibold"},F={class:"text-gray-600"},N={class:"bottom-1/2 left-1/2 flex justify-center mt-4"},V=["onClick"],q={class:"flex justify-center mt-2"},G=5e3,H={__name:"Carousel2",props:{test:{type:String}},setup(K){const l=d([{image:"https://cdn.pixabay.com/photo/2021/09/12/18/07/robin-6619184_1280.jpg",title:"Slide 1",description:"Description for Slide 1",animation:"fade"},{image:"https://cdn.pixabay.com/photo/2022/12/13/17/55/robin-7653878_1280.jpg",title:"Slide 2",description:"Description for Slide 2",animation:"zoom"},{image:"https://cdn.pixabay.com/photo/2017/03/05/21/06/bird-2119874_1280.jpg",title:"Slide 3",description:"Description for Slide 3",animation:"rotate"},{image:"https://cdn.pixabay.com/photo/2016/11/19/14/52/bird-1839689_1280.jpg",title:"Slide 4",description:"Description for Slide 4",animation:"slide-up"},{image:"https://cdn.pixabay.com/photo/2015/06/22/22/41/robin-818126_1280.jpg",title:"Slide 5",description:"Description for Slide 5",animation:"slide-down"}]),e=d(0),y=d(null),s=d(!0),c=()=>{e.value=(e.value+1)%l.value.length},p=()=>{e.value=(e.value-1+l.value.length)%l.value.length},k=i=>{e.value=i},m=()=>{s.value&&(y.value=setInterval(c,G))},f=()=>{clearInterval(y.value)},C=()=>{s.value=!s.value,s.value?m():f()};let b=0;const j=i=>{b=i.touches[0].clientX},A=i=>{let n=i.changedTouches[0].clientX,o=b-n;o>50?c():o<-50&&p()},_=i=>{i.key==="ArrowRight"?c():i.key==="ArrowLeft"&&p()};return T(()=>{m(),window.addEventListener("keydown",_)}),z(()=>{f(),window.removeEventListener("keydown",_)}),(i,n)=>(u(),r(v,null,[w(E(I),{title:"Carousel"},{default:h(()=>n[0]||(n[0]=[t("meta",{name:"description",content:"Custom Tailwind Carousel"},null,-1)])),_:1}),w(D,null,{header:h(()=>n[1]||(n[1]=[t("h2",{class:"text-xl font-semibold leading-tight text-gray-800"}," Carousel ",-1)])),default:h(()=>[t("div",L,[t("div",{class:"relative flex transition-transform duration-1000 ease-in-out slide-wrapper",style:X({transform:`translateX(-${e.value*100}%)`}),onMouseenter:f,onMouseleave:m,onTouchstart:j,onTouchend:A},[(u(!0),r(v,null,x(l.value,(o,a)=>(u(),r("div",{key:a,class:S(["w-full flex-shrink-0 inset-0 opacity-0 transition-opacity duration-1000 ease-in-out",{"opacity-100":a===e.value,"animate-fade":o.animation==="fade"&&a===e.value,"animate-zoom":o.animation==="zoom"&&a===e.value,"animate-rotate":o.animation==="rotate"&&a===e.value,"animate-slide-up":o.animation==="slide-up"&&a===e.value,"animate-slide-down":o.animation==="slide-down"&&a===e.value}])},[t("img",{src:o.image,alt:o.title,class:"w-full h-64 object-cover rounded-lg slide-img"},null,8,M),t("div",P,[t("h2",$,g(o.title),1),t("p",F,g(o.description),1),n[2]||(n[2]=t("button",{class:"mt-2 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600"},"More Details",-1))])],2))),128))],36),t("button",{class:"absolute top-1/2 left-2 transform -translate-y-1/2 bg-gray-800 text-white p-2 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",onClick:p},"‹"),t("button",{class:"absolute top-1/2 right-2 transform -translate-y-1/2 bg-gray-800 text-white p-2 rounded-full opacity-0 group-hover:opacity-100 transition-opacity",onClick:c},"›"),t("div",N,[(u(!0),r(v,null,x(l.value,(o,a)=>(u(),r("span",{key:a,class:S(["w-3 h-3 mx-1 rounded-full cursor-pointer",a===e.value?"bg-blue-500":"bg-gray-300"]),onClick:R=>k(a)},null,10,V))),128))]),t("div",q,[t("button",{class:"px-3 py-1 bg-gray-600 text-white text-sm rounded",onClick:C},g(s.value?"Pause":"Play")+" Autoplay ",1)])])]),_:1})],64))}},Y=B(H,[["__scopeId","data-v-2aeb65d8"]]);export{Y as default};
