{"version":3,"file":"HoverLine.aR4TOaIR.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/bkBD2dv3FMBzy6alaIcL/nLBUJgMhDW1TJs7t6zFu/HoverLine.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";export default function HoverLine(p){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=React.useRef(null);const[on,setOn]=React.useState(false);React.useEffect(()=>{if(isCanvas)return;const el=ref.current;if(!el)return;let reduce=false;try{reduce=window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;}catch(e){}const host=(p.scope&&p.scope!==\"link\"?el.closest(`[data-framer-name=\"${p.scope}\"]`):null)||el.closest(\"a\")||el.parentElement;if(!host)return;const media=()=>Array.from(host.querySelectorAll(\"img, video\")).filter(m=>!m.closest(\"[data-framer-name='Glyph'], [data-framer-name='Mark']\"));const photos=()=>Array.from(host.querySelectorAll(\"[data-framer-name='Row Photo']\"));const show=v=>{if(!p.reveal)return;for(const r of photos()){r.style.transition=reduce?\"opacity .3s ease\":\"opacity .4s ease, transform .7s cubic-bezier(.22,1,.36,1)\";r.style.opacity=v?\"1\":\"0\";if(!reduce)r.style.transform=v?\"translateY(0px) scale(1)\":\"translateY(14px) scale(0.97)\";}};show(false);const enter=()=>{setOn(true);show(true);if(p.zoom>1&&!reduce)for(const m of media()){const box=m.parentElement;if(box)box.style.overflow=\"hidden\";m.style.transition=`transform ${Math.max(.3,p.seconds*1.3)}s cubic-bezier(.22,1,.36,1)`;m.style.transform=`scale(${p.zoom})`;}};const leave=()=>{setOn(false);show(false);if(p.zoom>1)for(const m of media())m.style.transform=\"scale(1)\";};host.addEventListener(\"pointerenter\",enter);host.addEventListener(\"pointerleave\",leave);host.addEventListener(\"focusin\",enter);host.addEventListener(\"focusout\",leave);return()=>{host.removeEventListener(\"pointerenter\",enter);host.removeEventListener(\"pointerleave\",leave);host.removeEventListener(\"focusin\",enter);host.removeEventListener(\"focusout\",leave);};},[isCanvas,p.scope,p.zoom,p.seconds,p.reveal]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",height:1,background:p.line,overflow:\"hidden\"},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:0,top:0,height:1,width:on?\"100%\":\"0%\",background:p.fill,transition:`width ${Math.max(.2,p.seconds)}s cubic-bezier(.22,1,.36,1)`}})});}addPropertyControls(HoverLine,{line:{type:ControlType.Color,title:\"Line\",defaultValue:\"rgba(15,15,15,0.14)\"},fill:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#0F0F0F\"},scope:{type:ControlType.String,title:\"Hover scope\",defaultValue:\"link\",description:\"link = the nearest link around this rule, or the name of an ancestor frame\"},zoom:{type:ControlType.Number,title:\"Photo zoom\",defaultValue:1.03,min:1,max:1.2,step:.01},seconds:{type:ControlType.Number,title:\"Fill seconds\",defaultValue:.7,min:.2,max:3,step:.1},reveal:{type:ControlType.Boolean,title:\"Reveal photo\",defaultValue:false,description:\"Fades in a frame named Row Photo inside the card on hover\"},stayFilled:{type:ControlType.Boolean,title:\"Unused\",defaultValue:false,hidden:()=>true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverLine\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverLine.map"],"mappings":"6MAAwI,SAAwB,EAAU,EAAE,CAAC,IAAM,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAIA,EAAa,IAAI,EAAO,CAAC,EAAG,GAAOC,EAAe,EAAK,EAA+lD,OAA7lD,MAAoB,CAAC,GAAG,EAAS,OAAO,IAAM,EAAG,EAAI,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAI,EAAO,GAAM,GAAG,CAAC,EAAO,EAAO,WAAW,kCAA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