{"version":3,"file":"CardInteraction.BsK7szLR.mjs","names":["React.useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/K5tP1R1NNoRhiwNFTw4I/FFJD8UTkMotYx3wHOVg1/CardInteraction.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const CARD_CSS='\\n @media(min-width:1440px) and (hover:hover) and (pointer:fine){\\n :has(>.oar-card-surface) img{transition:transform 700ms ease-out!important}\\n :has(>.oar-card-surface):hover img{transform:scale(1.05)}\\n :has(>.oar-card-surface) :is(h2,h3){transition:translate 250ms ease-out!important}\\n :has(>.oar-card-surface):hover :is(h2,h3){translate:0 -4px}\\n .oar-card-surface.project{cursor:none}\\n :has(>.oar-card-surface) [data-framer-name=\"Watch the film\"] p::after,\\n :has(>.oar-card-surface) [data-framer-name=\"View project\"] p::after{content:\" ↗\";display:inline-block;opacity:0;transform:translateX(-4px);transition:transform 250ms ease-out,opacity 250ms ease-out}\\n :has(>.oar-card-surface:hover) [data-framer-name=\"Watch the film\"] p::after,\\n :has(>.oar-card-surface:hover) [data-framer-name=\"View project\"] p::after{opacity:1;transform:translateX(0)}\\n }\\n @media(hover:none){:has(>.oar-card-surface:active){scale:.98!important}}\\n @media(prefers-reduced-motion:reduce){\\n :has(>.oar-card-surface) img{transform:none!important;transition:none!important}\\n :has(>.oar-card-surface) :is(h2,h3){translate:none!important;transition:none!important}\\n :has(>.oar-card-surface:active){scale:1!important}\\n .oar-card-surface.project{cursor:pointer!important}\\n }\\n ';/** @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any */export default function CardInteraction({filmURL=\"\",cursor=true,cursorLabel=\"\",style}){const rules=React.useRef(null);React.useEffect(()=>{const node=rules.current;if(!node)return;node.textContent=CARD_CSS;return()=>{node.textContent=\"\";};},[]);const bubble=React.useRef(null),raf=React.useRef(0),active=React.useRef(false),point=React.useRef({x:0,y:0,tx:0,ty:0});const permitted=()=>cursor&&RenderTarget.current()!==RenderTarget.canvas&&window.matchMedia(\"(min-width:1440px) and (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference)\").matches;const draw=()=>{if(!permitted()){hide();return;}const p=point.current;p.x+=(p.tx-p.x)*.2;p.y+=(p.ty-p.y)*.2;if(bubble.current)bubble.current.style.transform=`translate3d(${p.x-36}px,${p.y-36}px,0)`;if(active.current)raf.current=requestAnimationFrame(draw);};const hide=()=>{active.current=false;cancelAnimationFrame(raf.current);if(bubble.current?.matches(\":popover-open\"))bubble.current.hidePopover();};React.useEffect(()=>{const overlay=e=>{if(e.detail?.open)hide();};window.addEventListener(\"oar-overlay-change\",overlay);window.addEventListener(\"blur\",hide);return()=>{hide();window.removeEventListener(\"oar-overlay-change\",overlay);window.removeEventListener(\"blur\",hide);};},[]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{className:cursor?\"oar-card-surface project\":\"oar-card-surface\",\"aria-hidden\":true,onPointerEnter:e=>{if(!permitted()||!bubble.current||!(\"showPopover\"in bubble.current))return;point.current={x:e.clientX,y:e.clientY,tx:e.clientX,ty:e.clientY};active.current=true;bubble.current.showPopover();draw();},onPointerMove:e=>{point.current.tx=e.clientX;point.current.ty=e.clientY;},onPointerLeave:hide,style:{...style,position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",zIndex:5,background:\"transparent\",pointerEvents:cursor?\"auto\":\"none\"}}),/*#__PURE__*/_jsx(\"div\",{ref:bubble,...{popover:\"manual\"},\"aria-hidden\":true,style:{position:\"fixed\",top:0,left:0,margin:0,width:72,height:72,padding:0,border:0,borderRadius:\"50%\",background:\"#E9E5DE\",color:\"#1F1D1A\",fontFamily:'\"Space Grotesk\",sans-serif',fontSize:13,fontWeight:500,textAlign:\"center\",lineHeight:\"72px\",pointerEvents:\"none\",zIndex:2e3},children:cursorLabel||(filmURL?\"Play\":\"View\")}),/*#__PURE__*/_jsx(\"style\",{ref:rules})]});}addPropertyControls(CardInteraction,{filmURL:{type:ControlType.Link,title:\"Hero film\"},cursor:{type:ControlType.Boolean,title:\"View cursor\",defaultValue:true},cursorLabel:{type:ControlType.String,title:\"Cursor label\",defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CardInteraction\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CardInteraction.map"],"mappings":"0MACsC,SAAwB,EAAgB,CAAC,UAAQ,GAAG,SAAO,GAAK,cAAY,GAAG,SAAO,CAAC,IAAM,EAAMA,EAAa,IAAI,EAAE,MAAoB,CAAC,IAAM,EAAK,EAAM,QAAY,KAAsC,MAA1B,GAAK,YAAY,MAAmB,CAAC,EAAK,YAAY,EAAG,CAAE,EAAE,CAAC,CAAC,EAAE,IAAM,EAAOA,EAAa,IAAI,EAAE,EAAIA,EAAa,CAAC,EAAE,EAAOA,EAAa,EAAK,EAAE,EAAMA,EAAa,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAQ,MAAc,GAAQ,EAAa,QAAQ,IAAI,EAAa,QAAQ,EAAO,WAAW,oGAAoG,CAAC,CAAC,QAAc,MAAS,CAAC,GAAG,CAAC,EAAU,EAAE,CAAC,EAAK,EAAE,MAAO,CAAC,IAAM,EAAE,EAAM,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,GAAM,EAAO,UAAQ,EAAO,QAAQ,MAAM,UAAU,eAAe,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,QAAU,EAAO,UAAQ,EAAI,QAAQ,sBAAsB,CAAI,EAAE,EAAQ,MAAS,CAAC,EAAO,QAAQ,GAAM,qBAAqB,EAA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