{"version":3,"file":"CollectionViewer.Cebn_KgF.mjs","names":["useMemo","useRef","useState","_Fragment","__esmMin","pe","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","le","l","_e","p","c","init_jsx_runtime","ce","de","init_framer_Bf4_tcb2","addPropertyControls","ControlType","inkFor","init_StripEngine","ExitMark","MediaStrip","CollectionViewer","baseBg","baseInk","props","media","images","srcOf","i","setOf","title","n","place","year","rootRef","w","setW","idx","setIdx","grid","setGrid","focus","setFocus","hoverExit","setHoverExit","tint","setTint","background","photoColor","ink","el","m","ro","onKey","phone","pad","fs","fontSize","text","FONT","btn","pad2","k","shown","bar","top","style","mainHeight","brand","g","homeHref","kind","note","init_CollectionViewer"],"sources":["https:/framerusercontent.com/modules/qCxGvl1Go04F2ogPBCdb/dwKIcZ3dP9VieMuHF6Aj/CollectionViewer.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useMemo,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{MediaStrip,inkFor,ExitMark}from\"https://framerusercontent.com/modules/EfMdnPEK70WcepieoiIn/2qb4raMESjjJOevnUWOP/StripEngine.js\";const FONT='\"Inter\", \"Inter Placeholder\", sans-serif';const srcOf=i=>typeof i===\"string\"?i:i?.src||\"\";const setOf=i=>typeof i===\"string\"?undefined:i?.srcSet;/**\n * Collection Viewer: one photo large in the middle, the rest in a strip at a quarter of its size.\n * Every photo moves on its own (no rubber-band row). It loops. Desktop has a Grid where the\n * photos fly into a contact sheet, and clicking one there enlarges it in place.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight fixed\n */export default function CollectionViewer(props){const{images,brand,title,kind,year,place,note,background:baseBg,ink:baseInk,homeHref,sideScale,mainHeight,mainWidth,gap,fontSize,loop,photoColor,style}=props;const media=useMemo(()=>(images||[]).filter(i=>srcOf(i)).map((i,n)=>({src:srcOf(i),srcSet:setOf(i),alt:`${title} ${n+1}`,caption:[place,year].filter(Boolean).join(\", \")})),[images,title,place,year]);const n=media.length;const rootRef=useRef(null);const[w,setW]=useState(1200);const[idx,setIdx]=useState(0);const[grid,setGrid]=useState(false);const[focus,setFocus]=useState(null);const[hoverExit,setHoverExit]=useState(false);const[tint,setTint]=useState(null);// background takes the most common colour of the photo in front; text flips black/white to stay readable\nconst background=photoColor&&tint?tint:baseBg;const ink=photoColor&&tint?inkFor(tint):baseInk;useLayoutEffect(()=>{const el=rootRef.current;if(!el)return;const m=()=>setW(el.clientWidth);m();const ro=new ResizeObserver(m);ro.observe(el);return()=>ro.disconnect();},[]);useEffect(()=>{const onKey=e=>{if(e.key===\"Escape\"&&grid&&focus===null)setGrid(false);};window.addEventListener(\"keydown\",onKey);return()=>window.removeEventListener(\"keydown\",onKey);},[grid,focus]);const phone=w<810;useEffect(()=>{if(phone&&grid)setGrid(false);},[phone]);const pad=phone?16:20;const fs=phone?Math.max(9,fontSize-1):fontSize;const text={fontFamily:FONT,fontWeight:600,fontSize:fs,lineHeight:1.25,letterSpacing:\"0.02em\",textTransform:\"uppercase\",color:ink,margin:0,transition:\"color .25s ease .3s\"};const btn={...text,background:\"none\",border:\"none\",padding:0,cursor:\"pointer\"};const pad2=k=>String(k).padStart(2,\"0\");const shown=grid&&focus!==null?focus:idx;const bar=top=>({position:\"absolute\",left:0,right:0,[top?\"top\":\"bottom\"]:0,padding:pad,background,transition:\"background-color .9s ease\",display:\"grid\",gridTemplateColumns:\"1fr auto 1fr\",alignItems:top?\"start\":\"end\",zIndex:10,pointerEvents:\"none\"});return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",background,transition:\"background-color .9s ease\",overflow:\"hidden\",userSelect:\"none\"},children:[n?/*#__PURE__*/_jsx(MediaStrip,{items:media,loop:loop,grid:grid,onIndex:setIdx,onFocus:setFocus,onColor:setTint,mainHeight:phone?Math.round(mainHeight/1.15):mainHeight,mainWidth:mainWidth,phoneMainWidth:.84,sideScale:sideScale,gap:gap,topSafe:pad+40,bottomSafe:pad+50,captionStyle:{...text,fontSize:Math.max(8,fs-2),fontWeight:500}}):null,/*#__PURE__*/_jsxs(\"div\",{style:bar(true),children:[/*#__PURE__*/_jsx(\"p\",{style:text,children:brand}),/*#__PURE__*/_jsx(\"p\",{style:{...text,textAlign:\"center\",maxWidth:phone?\"52vw\":520},children:title}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",justifyContent:\"flex-end\",alignItems:\"flex-start\",gap:phone?14:22,pointerEvents:\"auto\"},children:[!phone&&n>0?/*#__PURE__*/_jsx(\"button\",{type:\"button\",style:btn,onClick:()=>setGrid(g=>!g),children:grid?\"Close grid\":\"Grid\"}):null,/*#__PURE__*/_jsx(\"a\",{href:homeHref,\"aria-label\":\"Exit to home\",onMouseEnter:()=>setHoverExit(true),onFocus:()=>setHoverExit(true),style:{display:\"block\"},children:/*#__PURE__*/_jsx(ExitMark,{hovered:hoverExit,phone:phone,ink:ink,background:background,size:36,line:Math.round(fs*1.25)})})]})]}),/*#__PURE__*/_jsxs(\"div\",{style:bar(false),children:[/*#__PURE__*/_jsxs(\"p\",{style:text,children:[kind,note?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"br\",{}),note]}):null]}),/*#__PURE__*/_jsx(\"p\",{style:{...text,textAlign:\"center\"},children:n?`${pad2(shown+1)} / ${pad2(n)}`:\"—\"}),/*#__PURE__*/_jsxs(\"p\",{style:{...text,textAlign:\"right\"},children:[place,place&&year?/*#__PURE__*/_jsx(\"br\",{}):null,year]})]})]});}CollectionViewer.defaultProps={images:[],brand:\"Bavision\",title:\"Collection\",kind:\"Photography\",year:\"2026\",place:\"Montr\\xe9al\",note:\"\",background:\"#F3F2EF\",ink:\"#111111\",homeHref:\"/\",sideScale:.25,mainHeight:67,mainWidth:.575,gap:14,fontSize:10,loop:true,photoColor:true};addPropertyControls(CollectionViewer,{images:{type:ControlType.Array,title:\"Photos\",control:{type:ControlType.ResponsiveImage}},brand:{type:ControlType.String,title:\"Top left\",defaultValue:\"Bavision\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Collection\"},kind:{type:ControlType.String,title:\"Bottom left\",defaultValue:\"Photography\"},note:{type:ControlType.String,title:\"Bottom left 2\",defaultValue:\"\"},place:{type:ControlType.String,title:\"Place\",defaultValue:\"Montr\\xe9al\"},year:{type:ControlType.String,title:\"Year\",defaultValue:\"2026\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F3F2EF\"},ink:{type:ControlType.Color,title:\"Text\",defaultValue:\"#111111\"},homeHref:{type:ControlType.String,title:\"Exit to\",defaultValue:\"/\"},mainHeight:{type:ControlType.Number,title:\"Main size\",defaultValue:67,min:20,max:90,unit:\"%\"},mainWidth:{type:ControlType.Number,title:\"Main width\",defaultValue:.575,min:.2,max:.95,step:.005},sideScale:{type:ControlType.Number,title:\"Side size\",defaultValue:.25,min:.1,max:.6,step:.01},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:14,min:0,max:60,unit:\"px\"},fontSize:{type:ControlType.Number,title:\"Text size\",defaultValue:10,min:8,max:18,unit:\"px\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true},photoColor:{type:ControlType.Boolean,title:\"Photo colour bg\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CollectionViewer\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CollectionViewer.map"],"mappings":"A,wSAOG,SAAwBwB,EAAiB,EAAM,CAAC,GAAK,CAAC,SAAO,QAAM,QAAM,OAAK,OAAK,QAAM,OAAK,WAAWC,EAAO,IAAIC,EAAQ,WAAS,YAAU,aAAW,YAAU,MAAI,WAAS,OAAK,aAAW,SAAOC,EAAYC,E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