{"version":3,"file":"StoryCard.D7sprkL4.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/DnBYAl4aQ6wUyo47upBX/MOe3hXvJcZgM2liExSx2/StoryCard.js"],"sourcesContent":["// Story card for \"Featured work\": a 4:5 cover image, the couple's names in the serif and a small meta\n// line (\"{venue} · {location}\"). Hovering the card zooms the image to 1.04 inside its frame (1s) and draws\n// a thin underline under the names; if a Preview Clip is set, it fades in and plays muted over the image. Cards come into focus as they scroll in, with a 0.12s stagger per\n// column. Bind the fields to the Films collection and put the link on the layer that wraps the card.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";// Only fetch images once the component is close to the screen (Framer drops loading=\"lazy\" on export).\nfunction useNear(ref,margin=\"600px\"){const isStaticNear=useIsStaticRenderer();const[near,setNear]=useState(false);useEffect(()=>{if(near||isStaticNear)return;const el=ref.current;if(!el||typeof IntersectionObserver===\"undefined\"){setNear(true);return;}const io=new IntersectionObserver(e=>{if(e.some(x=>x.isIntersecting)){setNear(true);io.disconnect();}},{rootMargin:margin});io.observe(el);return()=>io.disconnect();},[near,isStaticNear]);return near||isStaticNear;}const SERIF=`\"Fraunces\", \"Fraunces Placeholder\", Georgia, serif`;const SANS=`\"Jost\", \"Jost Placeholder\", system-ui, sans-serif`;const EASE=\"cubic-bezier(0.25, 0.1, 0.25, 1)\";const DEFAULT=\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 380\n */export default function StoryCard(props){const{image,clip=\"\",couple=\"Eleanor & James\",venue=\"Aldcot Manor\",location=\"Cotswolds\",sizes=\"min(92vw, 400px)\",order=1,ink=\"#232220\",mute=\"#6F6B64\"}=props;const isStatic=useIsStaticRenderer();const root=useRef(null);const near=useNear(root);const[shown,setShown]=useState(isStatic);const[delay,setDelay]=useState(0);const[ready,setReady]=useState(false);const[armed,setArmed]=useState(false);const video=useRef(null);const hasClip=typeof clip===\"string\"&&/\\.(mp4|webm|mov)(\\?|$)/i.test(clip);const enter=()=>{if(!hasClip||!window.matchMedia(\"(hover: hover)\").matches||window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;setArmed(true);const v=video.current;if(v){v.currentTime=0;v.play().catch(()=>{});}};const leave=()=>{video.current?.pause();};const img=!image?{src:DEFAULT}:typeof image===\"string\"?{src:image}:{src:image.src||DEFAULT,srcSet:image.srcSet,alt:image.alt};// Reveal when our own box reaches 80% of the screen; Order (1, 2, 3…) sets a 0.12s stagger per column.\nuseEffect(()=>{if(isStatic)return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches){setShown(true);return;}setReady(true);let raf=0;let done=false;const check=()=>{raf=0;const el=root.current;if(!el||done)return;const r=el.getBoundingClientRect();if(r.top<window.innerHeight*.8&&r.bottom>0){done=true;const col=(Math.max(1,Math.round(Number(order)||1))-1)%3;startTransition(()=>{setDelay(window.innerWidth<810?0:col*.12);setShown(true);});}};const on=()=>{if(!raf)raf=requestAnimationFrame(check);};const first=window.setTimeout(check,60);const safety=window.setTimeout(()=>{done=true;setShown(true);},8e3);window.addEventListener(\"scroll\",on,{passive:true});window.addEventListener(\"resize\",on);return()=>{cancelAnimationFrame(raf);window.clearTimeout(first);window.clearTimeout(safety);window.removeEventListener(\"scroll\",on);window.removeEventListener(\"resize\",on);};},[isStatic,order]);const css=`\n.csc-card .csc-img{transition:transform 1s ${EASE}}\n.csc-card .csc-clip{opacity:0;transition:opacity .5s ${EASE}}\n@media (hover:hover){.csc-card:hover .csc-clip{opacity:1}}\n.csc-card .csc-line{transform:scaleX(0);transform-origin:0 50%;transition:transform .6s ${EASE}}\n@media (hover:hover){.csc-card:hover .csc-img{transform:scale(1.04)}.csc-card:hover .csc-line{transform:scaleX(1)}}\n`;const hidden=ready&&!shown;return /*#__PURE__*/_jsxs(\"div\",{ref:root,className:\"csc-card\",onMouseEnter:enter,onMouseLeave:leave,style:{...props.style,position:\"relative\",width:\"100%\",height:\"auto\",display:\"flex\",flexDirection:\"column\",gap:18,opacity:hidden?0:1,filter:hidden?\"blur(10px)\":\"blur(0px)\",transform:hidden?\"translateY(20px)\":\"none\",transition:ready?`opacity 1.1s ${EASE} ${delay}s, filter 1.1s ${EASE} ${delay}s, transform 1.1s ${EASE} ${delay}s`:undefined},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:css}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:\"4 / 5\",overflow:\"hidden\",background:\"#EFEDE8\"},children:[/*#__PURE__*/_jsx(\"img\",{className:\"csc-img\",src:near?img.src:undefined,srcSet:near?img.srcSet:undefined,sizes:sizes,alt:img.alt||couple,loading:\"lazy\",decoding:\"async\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}}),armed?/*#__PURE__*/_jsx(\"video\",{ref:el=>{video.current=el;if(el&&el.paused)el.play().catch(()=>{});},className:\"csc-clip\",src:clip,muted:true,loop:true,playsInline:true,preload:\"auto\",\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}}):null]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:8},children:[/*#__PURE__*/_jsxs(\"span\",{style:{position:\"relative\",alignSelf:\"flex-start\",fontFamily:SERIF,fontWeight:300,fontSize:22,lineHeight:\"1.3em\",color:ink,paddingBottom:3},children:[couple,/*#__PURE__*/_jsx(\"span\",{className:\"csc-line\",\"aria-hidden\":\"true\",style:{position:\"absolute\",left:0,right:0,bottom:0,height:1,background:ink}})]}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:SANS,fontSize:12,fontWeight:500,letterSpacing:\".18em\",textTransform:\"uppercase\",lineHeight:\"1.5em\",color:mute},children:[venue,location].filter(x=>typeof x===\"string\"&&x.trim()).join(\"  \\xb7  \")})]})]});}addPropertyControls(StoryCard,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},clip:{type:ControlType.Link,title:\"Preview Clip\"},couple:{type:ControlType.String,title:\"Couple\",defaultValue:\"Eleanor & James\"},venue:{type:ControlType.String,title:\"Venue\",defaultValue:\"Aldcot Manor\"},location:{type:ControlType.String,title:\"Location\",defaultValue:\"Cotswolds\"},sizes:{type:ControlType.String,title:\"Image sizes\",defaultValue:\"min(92vw, 400px)\"},order:{type:ControlType.Number,title:\"Order (stagger)\",defaultValue:1},ink:{type:ControlType.Color,title:\"Names\",defaultValue:\"#232220\"},mute:{type:ControlType.Color,title:\"Meta\",defaultValue:\"#6F6B64\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StoryCard\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"380\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StoryCard.map"],"mappings":"4NAKA,SAAS,EAAQ,EAAI,EAAO,QAAQ,CAAC,IAAM,EAAa,EAAoB,EAAO,CAAC,EAAK,GAASA,EAAS,EAAK,EAAwU,OAAtU,MAAc,CAAC,GAAG,GAAM,EAAa,OAAO,IAAM,EAAG,EAAI,QAAQ,GAAG,CAAC,GAAI,OAAO,qBAAuB,IAAY,CAAC,EAAQ,EAAI,EAAE,MAAO,CAAC,IAAM,EAAG,IAAI,qBAAqB,GAAG,CAAI,EAAE,KAAK,GAAG,EAAE,cAAc,IAAG,EAAQ,EAAI,EAAE,EAAG,WAAW,EAAG,EAAE,CAAC,WAAW,CAAM,CAAC,EAAiB,OAAf,EAAG,QAAQ,CAAE,MAAY,EAAG,WAAW,CAAE,EAAE,CAAC,EAAK,CAAY,CAAC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