import{j as e}from"./jsx-runtime.391947bd.js";import{r as a}from"./index.ed373d49.js";const d=({pictures:s})=>{a.useRef(0);const[r,l]=a.useState(0),i=a.useRef(null),u=()=>{r>0&&l(t=>t-1)},c=()=>{rt+1)},o=t=>t==="prev"?r<=0:t==="next"&&r>=s.length-1?r>=s.length-1:!1;function g(t,n){switch(n){case r:return"translate-x-0 z-20";case r-1:return"-translate-x-full z-10";case r+1:return"translate-x-full z-10";default:return"hidden"}}return e.jsxs("div",{className:"relative w-full",children:[e.jsx("div",{ref:i,className:"relative h-56 overflow-hidden rounded-xl md:h-64",children:s.map((t,n)=>e.jsx("div",{className:`duration-700 ease-in-out transition-transform ${g(t,n)}`,children:e.jsx("a",{href:t.image||"",target:"_blank",className:"absolute block w-full h-full -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2",children:e.jsx("img",{src:t.image||"",alt:t.title,className:"object-cover h-64 w-full"})})},n))}),e.jsx("div",{className:"absolute z-30 flex space-x-3 -translate-x-1/2 bottom-5 left-1/2",children:s.map((t,n)=>e.jsx("button",{type:"button",className:"w-3 h-3 rounded-full","aria-current":t.title===s[r].title,"aria-label":t.title,onClick:()=>l(n)}))}),e.jsx("button",{type:"button",className:"absolute top-0 left-0 z-30 flex items-center justify-center h-full px-4 cursor-pointer group focus:outline-none",onClick:u,disabled:o("prev"),children:e.jsxs("span",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none",children:[e.jsx("svg",{className:"w-4 h-4 text-white dark:text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsx("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 1 1 5l4 4"})}),e.jsx("span",{className:"sr-only",children:"Previous"})]})}),e.jsx("button",{type:"button",className:"absolute top-0 right-0 z-30 flex items-center justify-center h-full px-4 cursor-pointer group focus:outline-none",onClick:c,disabled:o("next"),children:e.jsxs("span",{className:"inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none",children:[e.jsx("svg",{className:"w-4 h-4 text-white dark:text-gray-800","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 6 10",children:e.jsx("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m1 9 4-4-4-4"})}),e.jsx("span",{className:"sr-only",children:"Next"})]})})]})},h=[{title:"Drone Picture of Hampshire College",image:"/img/DJI_0565.JPG"},{title:"Drone Picture of Hampshire College (winter)",image:"/img/DJI_0605.JPG"},{title:"Bean!!",image:"/img/IMG_0196.JPG"},{title:"Ricky!!",image:"/img/IMG_3942.JPG"}];function m(){return e.jsx("div",{className:"h-64",children:e.jsx(d,{pictures:h})})}export{m as default};