{"version":3,"file":"LMFLPhotoCard.BqG3ucff.mjs","names":["useState","useRef","startTransition"],"sources":["https:/framerusercontent.com/modules/Acki1MTMWPzifkhGpBIo/hbO7BJMGbjOJpe6QDsKa/LMFLPhotoCard.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * LMFL Photo Card\n * Rounded photo card with a soft dark fade and white serif title. On hover it lifts and the photo\n * zooms gently (same style as the Tutor and Module cards).\n * Optional link makes the whole card clickable. Change the photo with \"Image\" in the right panel.\n * Slideshow: add two or more photos under \"Slideshow\" and the card slowly cross-fades between them\n * (it pauses while off screen; visitors who prefer reduced motion see the first photo only).\n * The small label is shown in capitals; any \" · \" in it is shown as a comma.\n * Photo alt text: the image's own alt text, else the card's title, else \"LMFL summer course\".\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 520\n * @framerIntrinsicHeight 420\n */function sized(src,w){if(!src||!/framerusercontent\\.com\\/images\\//.test(src))return src;return`${src.split(\"?\")[0]}?scale-down-to=${w}`;}const srcOfImg=p=>!p?\"\":typeof p===\"string\"?p:p.src||\"\";const noDots=s=>String(s||\"\").replace(/\\s*·\\s*/g,\", \");export default function LMFLPhotoCard(props){const{image,imageUrl,slides,slideUrls,interval,label,title,text,cta,link,newTab,radius,align,style}=props;const[hover,setHover]=useState(false);const src=image&&(typeof image===\"string\"?image:image.src)||imageUrl;const isFramer=src&&/framerusercontent\\.com\\/images\\//.test(src);const srcSet=image&&typeof image===\"object\"&&image.srcSet?image.srcSet:isFramer?`${sized(src,512)} 512w, ${sized(src,1024)} 1024w, ${sized(src,2048)} 2048w`:undefined;const serif=`\"EB Garamond\", Georgia, serif`;const ease=\"cubic-bezier(0.2, 0.7, 0.2, 1)\";const altBase=typeof title===\"string\"&&title.trim()||\"LMFL summer course\";// slideshow (optional)\nconst fromPanel=(slides||[]).map(srcOfImg).filter(Boolean);const fromText=String(slideUrls||\"\").split(/[\\s,]+/).filter(u=>/^https?:\\/\\//.test(u));const pool=fromPanel.length>1?fromPanel:fromText.length>1?fromText:[];const[cur,setCur]=useState(0);const rootRef=useRef(null);useEffect(()=>{if(pool.length<2||typeof window===\"undefined\")return;if(window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;let visible=true;let io=null;if(rootRef.current&&typeof IntersectionObserver!==\"undefined\"){io=new IntersectionObserver(e=>visible=e[0].isIntersecting);io.observe(rootRef.current);}const id=window.setInterval(()=>{if(!visible||document.hidden)return;// preload the next photo before fading to it\nsetCur(c=>{const n=(c+1)%pool.length;const im=new Image;im.src=sized(pool[(n+1)%pool.length],1024);return n;});},Math.max(2.5,interval||5)*1e3);return()=>{window.clearInterval(id);if(io)io.disconnect();};},[pool.length,interval]);const imgStyle=on=>({position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",opacity:on?1:0,transform:hover?\"scale(1.07)\":on?\"scale(1.02)\":\"scale(1.06)\",transition:`opacity 1.4s ease, transform ${hover?\".7s\":\"6s\"} ${ease}`});const inner=/*#__PURE__*/_jsxs(\"div\",{ref:rootRef,onMouseEnter:()=>startTransition(()=>setHover(true)),onMouseLeave:()=>startTransition(()=>setHover(false)),style:{position:\"relative\",width:\"100%\",height:\"100%\",minHeight:220,borderRadius:radius,overflow:\"hidden\",isolation:\"isolate\",background:\"rgb(40, 34, 30)\",cursor:link?\"pointer\":\"default\",transform:hover?\"translateY(-6px)\":\"none\",boxShadow:hover?\"0 22px 44px rgba(16,12,10,.18), 0 4px 10px rgba(16,12,10,.08)\":\"0 0 0 rgba(0,0,0,0)\",transition:`transform .45s ${ease}, box-shadow .45s ${ease}`},children:[pool.length>1?pool.map((u,i)=>{// only mount the current, previous and next photos\nconst near=i===cur||i===(cur+1)%pool.length||i===(cur-1+pool.length)%pool.length;return near?/*#__PURE__*/_jsx(\"img\",{src:sized(u,1024),alt:i===cur?altBase:\"\",\"aria-hidden\":i===cur?undefined:true,loading:i===0?\"lazy\":\"lazy\",decoding:\"async\",style:imgStyle(i===cur)},u+i):null;}):src?/*#__PURE__*/_jsx(\"img\",{src:isFramer?sized(src,1024):src,srcSet:srcSet,sizes:\"(max-width: 810px) 100vw, 600px\",alt:image&&image.alt||altBase,loading:\"lazy\",decoding:\"async\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",transform:hover?\"scale(1.07)\":\"scale(1)\",transition:`transform .7s ${ease}`}}):null,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:\"linear-gradient(180deg, rgba(10,8,7,0) 30%, rgba(10,8,7,0.35) 55%, rgba(10,8,7,0.82) 100%)\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",left:0,right:0,bottom:0,padding:\"0 32px 30px\",color:\"#fff\",fontFamily:serif,textAlign:align,textShadow:\"0 1px 18px rgba(0,0,0,0.25)\",zIndex:2},children:[label?/*#__PURE__*/_jsx(\"div\",{style:{fontSize:14,letterSpacing:\"0.04em\",textTransform:\"uppercase\",opacity:.9,marginBottom:8},children:noDots(label)}):null,/*#__PURE__*/_jsx(\"div\",{style:{fontSize:30,lineHeight:1.12,fontWeight:400},children:title}),text?/*#__PURE__*/_jsx(\"div\",{style:{fontSize:17,lineHeight:1.5,opacity:.92,marginTop:10,maxWidth:520,marginLeft:align===\"center\"?\"auto\":0,marginRight:align===\"center\"?\"auto\":0},children:text}):null,cta?/*#__PURE__*/_jsx(\"div\",{style:{display:\"inline-block\",fontSize:17,opacity:hover?1:.9,marginTop:14,paddingBottom:1,borderBottom:`1px solid ${hover?\"rgba(255,255,255,0.95)\":\"rgba(255,255,255,0.4)\"}`,transition:\"border-color 0.3s ease, opacity 0.3s ease\"},children:cta}):null]})]});return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\"},children:link?/*#__PURE__*/_jsx(\"a\",{href:link,target:newTab?\"_blank\":undefined,rel:newTab?\"noopener\":undefined,style:{display:\"block\",width:\"100%\",height:\"100%\",textDecoration:\"none\",color:\"inherit\"},children:inner}):inner});}LMFLPhotoCard.defaultProps={imageUrl:\"https://framerusercontent.com/images/wN4bNRvtN4AmEeovZX5gFYkv9Kk.jpg\",label:\"Label\",title:\"Card title\",text:\"\",cta:\"Learn more\",radius:16,align:\"left\",newTab:false,interval:5,slideUrls:\"\"};addPropertyControls(LMFLPhotoCard,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},imageUrl:{type:ControlType.String,title:\"Default URL\"},slides:{type:ControlType.Array,title:\"Slideshow\",control:{type:ControlType.ResponsiveImage}},slideUrls:{type:ControlType.String,title:\"Slide URLs\",displayTextArea:true,description:\"Optional: image links, one per line (used if Slideshow is empty).\"},interval:{type:ControlType.Number,title:\"Slide every\",min:2.5,max:15,step:.5,unit:\"s\"},label:{type:ControlType.String,title:\"Small label\"},title:{type:ControlType.String,title:\"Title\"},text:{type:ControlType.String,title:\"Text\",displayTextArea:true},cta:{type:ControlType.String,title:\"Link text\"},link:{type:ControlType.Link,title:\"Link\"},newTab:{type:ControlType.Boolean,title:\"New tab\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\"],optionTitles:[\"Left\",\"Center\"],displaySegmentedControl:true},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:40,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LMFLPhotoCard\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LMFLPhotoCard.map"],"mappings":"0MAcG,SAAS,EAAM,EAAI,EAAE,CAAmE,MAA/D,CAAC,GAAK,CAAC,mCAAmC,KAAK,CAAG,EAAS,EAAU,GAAG,EAAI,MAAM,GAAG,CAAC,CAAC,GAAG,iBAAiB,GAAI,CAAgH,SAAwB,EAAc,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