PageSourceSearch

https://www.abbeytheatre.co.uk/assets/Gallery-DmmxAg3R.js

js abbeytheatre.co.uk collected 2026-09-25 08:03:53 UTC 4,283 bytes, 1 lines download raw bytes

1import{r as l,j as e,S as E,H as S,a6 as f,a7 as D,a8 as p,D as G,w as L,B as m,aa as z,a1 as A,Z as R,F as T,s as j}from"./index-tvAeWDDu.js";function B(){const[h,v]=l.useState([]),[b,d]=l.useState(!0),[y,i]=l.useState(!1),[o,g]=l.useState(0),[t,N]=l.useState([]);l.useEffect(()=>{(async()=>{const{data:s,error:c}=await j.from("gallery_categories").select("*").eq("is_active",!0).order("display_order",{ascending:!0});if(c){console.error("Error fetching categories:",c),d(!1);return}const{data:_,error:x}=await j.from("gallery_images").select("*").eq("is_active",!0).order("display_order",{ascending:!0});if(x){console.error("Error fetching images:",x),d(!1);return}const u=(s||[]).map(r=>({...r,images:(_||[]).filter(I=>I.category_id===r.id)})).filter(r=>r.images.length>0);v(u);const C=u.flatMap(r=>r.images);N(C),d(!1)})()},[]);const w=a=>{const s=t.findIndex(c=>c.id===a.id);g(s>=0?s:0),i(!0)},n=a=>{g(a==="prev"?s=>s>0?s-1:t.length-1:s=>s<t.length-1?s+1:0)},k=a=>{a.key==="ArrowLeft"&&n("prev"),a.key==="ArrowRight"&&n("next"),a.key==="Escape"&&i(!1)};return e.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[e.jsx(E,{title:"Gallery",description:"Browse photos from past productions, events and behind-the-scenes moments at The Abbey Theatre, Nuneaton."}),e.jsx(S,{}),e.jsxs("section",{className:"relative h-[40vh] min-h-[300px] flex items-center justify-center overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary/90 to-primary/70"}),e.jsxs("div",{className:"relative z-10 text-center px-4",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-bold text-primary-foreground mb-4",children:"Gallery"}),e.jsx("p",{className:"text-lg text-primary-foreground/80 max-w-2xl mx-auto",children:"Take a look around The Abbey Theatre"})]})]}),e.jsx("main",{className:"flex-1 container mx-auto px-4 py-12",children:b?e.jsx("div",{className:"space-y-12",children:[1,2].map(a=>e.jsxs("div",{children:[e.jsx(f,{className:"h-8 w-48 mb-6"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[1,2,3,4,5,6].map(s=>e.jsx(f,{className:"aspect-[4/3] rounded-lg"},s))})]},a))}):h.length===0?e.jsx("div",{className:"text-center py-16",children:e.jsx("p",{className:"text-muted-foreground text-lg",children:"No gallery images available yet."})}):e.jsx("div",{className:"space-y-12",children:h.map(a=>e.jsxs("section",{children:[e.jsx("h2",{className:"text-2xl font-bold text-foreground mb-6",children:a.name}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:a.images.map(s=>e.jsxs("button",{onClick:()=>w(s),className:"group relative overflow-hidden rounded-lg bg-muted focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:[e.jsx(D,{src:p(s.image_url),alt:s.alt_text||"Gallery image",loading:"lazy",aspectRatio:"aspect-[4/3]",className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",showSkeleton:!0}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/20 transition-colors duration-300"})]},s.id))})]},a.id))})}),e.jsx(G,{open:y,onOpenChange:i,children:e.jsx(L,{className:"max-w-[95vw] max-h-[95vh] p-0 bg-black/95 border-none",onKeyDown:k,children:e.jsxs("div",{className:"relative flex items-center justify-center min-h-[50vh]",children:[t[o]&&e.jsx("img",{src:p(t[o].image_url),alt:t[o].alt_text||"Gallery image",className:"max-w-full max-h-[85vh] object-contain"}),t.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(m,{variant:"ghost",size:"icon",className:"absolute left-2 top-1/2 -translate-y-1/2 text-white hover:bg-white/20 h-12 w-12",onClick:()=>n("prev"),children:e.jsx(z,{className:"h-8 w-8"})}),e.jsx(m,{variant:"ghost",size:"icon",className:"absolute right-2 top-1/2 -translate-y-1/2 text-white hover:bg-white/20 h-12 w-12",onClick:()=>n("next"),children:e.jsx(A,{className:"h-8 w-8"})})]}),e.jsx(m,{variant:"ghost",size:"icon",className:"absolute top-2 right-2 text-white hover:bg-white/20",onClick:()=>i(!1),children:e.jsx(R,{className:"h-6 w-6"})}),e.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/80 text-sm",children:[o+1," / ",t.length]})]})})}),e.jsx(T,{})]})}
1export{B as default};

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.