PageSourceSearch

https://wtfc.ca/assets/GalleryDetail-D7wwDf6a.js

js wtfc.ca collected 2026-10-04 06:22:56 UTC 7,376 bytes, 1 lines download raw bytes

1import{s as T,u as A,r as n,d as G,aS as O,aT as q,j as e,P as v,_ as f,L as D,n as i,B,i as F,ab as K,C as _}from"./index-CgaGlvxl.js";import{D as Q,a as X}from"./dialog-BwXpTk5Z.js";import{A as U}from"./arrow-left-BP-rkUH3.js";import{D as $}from"./download-B17CynDe.js";import{C as H}from"./chevron-left-Dgx7RTMK.js";import{S as J}from"./share-2-DaXEV8U5.js";import"./index-B4dzTveH.js";function ae(){var C,L;const{slug:N}=T(),{i18n:x,t:o}=A(),[g,u]=n.useState(!1),[h,b]=n.useState(0),{data:c,isLoading:E}=G({queryKey:["/api/galleries",N],enabled:!!N}),a=c?O(c,x.language):null,s=((C=c==null?void 0:c.images)==null?void 0:C.map(t=>q(t,x.language)))||[],I=t=>t?new Date(t).toLocaleDateString(x.language==="fr"?"fr-CA":"en-CA",{weekday:"long",month:"long",day:"numeric",year:"numeric"}):"",P=t=>{b(t),u(!0)},y=()=>{u(!1)},p=n.useCallback(()=>{b(t=>(t-1+s.length)%s.length)},[s.length]),w=n.useCallback(()=>{b(t=>(t+1)%s.length)},[s.length]),j=n.useCallback(t=>{g&&(t.key==="ArrowLeft"&&p(),t.key==="ArrowRight"&&w(),t.key==="Escape"&&y())},[g,p,w]);n.useEffect(()=>(window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)),[j]);const k=async(t,r)=>{try{const S=await(await fetch(t)).blob(),z=window.URL.createObjectURL(S),d=document.createElement("a");d.href=z,d.download=r||"image.jpg",document.body.appendChild(d),d.click(),document.body.removeChild(d),window.URL.revokeObjectURL(z)}catch{window.open(t,"_blank")}},R=async(t,r)=>{if(navigator.share)try{await navigator.share({title:r,url:window.location.href})}catch{}else navigator.clipboard.writeText(window.location.href)};if(E)return e.jsx(v,{children:e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-[400px] bg-muted"}),e.jsx("div",{className:"max-w-7xl mx-auto px-4 py-16",children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[1,2,3,4,5,6,7,8].map(t=>e.jsx("div",{className:"aspect-square bg-muted rounded-lg"},t))})})]})});if(!a)return e.jsx(v,{children:e.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx(f,{className:"w-16 h-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-4",children:o("common.notFound")}),e.jsx(D,{href:"/gallery",children:e.jsxs(i,{"data-testid":"button-back-to-galleries",children:[e.jsx(U,{className:"w-4 h-4 mr-2"}),o("gallery.backToGalleries")]})})]})})});const l=s[h];return e.jsxs(v,{children:[e.jsxs("section",{className:"relative h-[400px] md:h-[500px] overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/80 via-black/60 to-black/40 z-10"}),a.coverImage?e.jsx("img",{src:a.coverImage,alt:a.title,className:"absolute inset-0 w-full h-full object-cover"}):(L=s[0])!=null&&L.imageUrl?e.jsx("img",{src:s[0].imageUrl,alt:a.title,className:"absolute inset-0 w-full h-full object-cover"}):e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/20 to-primary/5"}),e.jsx("div",{className:"relative z-20 h-full flex items-center",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 w-full",children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx(D,{href:"/gallery",children:e.jsxs(i,{variant:"ghost",className:"mb-4 text-white/80 hover:text-white hover:bg-white/10","data-testid":"button-back-gallery",children:[e.jsx(U,{className:"w-4 h-4 mr-2"}),o("gallery.backToGalleries")]})}),e.jsxs(B,{className:"mb-4 bg-primary/90 hover:bg-primary text-white border-0",children:[e.jsx(f,{className:"w-3 h-3 mr-1"}),s.length," ",o("gallery.photos")]}),e.jsx("h1",{className:"text-4xl sm:text-5xl md:text-6xl font-bold text-white mb-4 leading-tight",children:a.title}),a.eventDate&&e.jsxs("div",{className:"flex items-center gap-2 text-white/90 mb-4",children:[e.jsx(F,{className:"w-5 h-5"}),e.jsx("span",{className:"text-lg",children:I(a.eventDate)})]}),a.description&&e.jsx("p",{className:"text-lg text-white/80 max-w-2xl",children:a.description})]})})})]}),e.jsx("section",{className:"py-16 bg-background",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(f,{className:"w-16 h-16 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No photos in this gallery yet."})]}):e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3 md:gap-4",children:s.map((t,r)=>e.jsxs("div",{className:"aspect-square relative group cursor-pointer overflow-hidden rounded-lg",onClick:()=>P(r),"data-testid":`image-gallery-${t.id}`,children:[e.jsx("img",{src:t.imageUrl,alt:t.caption||`Photo ${r+1}`,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-110",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/30 transition-colors duration-300 flex items-center justify-center",children:e.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex gap-2",children:e.jsx(i,{size:"icon",variant:"ghost",className:"bg-white/20 backdrop-blur-sm text-white hover:bg-white/30",onClick:m=>{m.stopPropagation(),k(t.imageUrl,`${a.title}-${r+1}.jpg`)},"data-testid":`button-download-${t.id}`,children:e.jsx($,{className:"w-4 h-4"})})})})]},t.id))})})}),e.jsx(Q,{open:g,onOpenChange:u,children:e.jsx(X,{className:"max-w-[95vw] max-h-[95vh] p-0 border-0 bg-black/95 [&>button]:hidden",children:e.jsxs("div",{className:"relative w-full h-[90vh] flex items-center justify-center",children:[e.jsx(i,{size:"icon",variant:"ghost",className:"absolute top-4 right-4 z-50 text-white hover:bg-white/20",onClick:y,"data-testid":"button-lightbox-close",children:e.jsx(K,{className:"w-6 h-6"})}),s.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(i,{size:"icon",variant:"ghost",className:"absolute left-4 top-1/2 -translate-y-1/2 z-50 text-white hover:bg-white/20",onClick:p,"data-testid":"button-lightbox-prev",children:e.jsx(H,{className:"w-8 h-8"})}),e.jsx(i,{size:"icon",variant:"ghost",className:"absolute right-4 top-1/2 -translate-y-1/2 z-50 text-white hover:bg-white/20",onClick:w,"data-testid":"button-lightbox-next",children:e.jsx(_,{className:"w-8 h-8"})})]}),e.jsxs("div",{className:"flex flex-col items-center max-w-full max-h-full p-4",children:[l&&e.jsx("img",{src:l.imageUrl,alt:l.caption||`Photo ${h+1}`,className:"max-w-full max-h-[75vh] object-contain"}),e.jsxs("div",{className:"mt-4 flex flex-col items-center gap-3",children:[(l==null?void 0:l.caption)&&e.jsx("p",{className:"text-white/80 text-center max-w-2xl",children:l.caption}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("span",{className:"text-white/60 text-sm",children:[h+1," / ",s.length]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(i,{size:"sm",variant:"ghost",className:"text-white hover:bg-white/20",onClick:()=>l&&k(l.imageUrl,`${a.title}-${h+1}.jpg`),"data-testid":"button-lightbox-download",children:[e.jsx($,{className:"w-4 h-4 mr-2"}),o("gallery.downloadImage")]}),e.jsxs(i,{size:"sm",variant:"ghost",className:"text-white hover:bg-white/20",onClick:()=>R((l==null?void 0:l.imageUrl)||"",a.title),"data-testid":"button-lightbox-share",children:[e.jsx(J,{className:"w-4 h-4 mr-2"}),o("gallery.shareImage")]})]})]})]})]})]})})})]})}export{ae 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.