{"version":3,"file":"DownloadResumeButton.DjdIsRYt.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/VItBEOvDCMsbjMmYw3w7/thRw9iHehXFYhKPJQOOj/DownloadResumeButton.js"],"sourcesContent":["// Button that lets users download PDF of my resume\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function DownloadResumeButton(props){const{label,previewLabel,pdfUrl,fileName,backgroundColor,textColor,hoverBackgroundColor,hoverTextColor,borderRadius,font,style,overlayPadding,buttonGap,buttonPadding,iconSize,previewTextColor,hidePreviewOnMobile,overlayZIndex,previewWidth,previewHeight,dimmerOpacity,animationDuration}=props;const[showPreview,setShowPreview]=useState(false);const[isAnimating,setIsAnimating]=useState(false);const handleDownload=()=>{if(typeof window===\"undefined\")return;window.open(pdfUrl,\"_blank\");};const buttonBaseStyle={backgroundColor,color:textColor,border:\"none\",padding:buttonPadding,cursor:\"pointer\",transition:\"all 0.2s ease\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:8,...font};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"flex\",alignItems:\"center\",gap:buttonGap,width:\"max-content\"},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:handleDownload,style:{...buttonBaseStyle,borderRadius:borderRadius},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=hoverBackgroundColor;e.currentTarget.style.color=hoverTextColor;},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=backgroundColor;e.currentTarget.style.color=textColor;},\"aria-label\":`Download ${fileName}`,children:[/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 16 16\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M8 11L4 7H6.5V2H9.5V7H12L8 11Z\",fill:\"currentColor\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M2 13V14H14V13H2Z\",fill:\"currentColor\"})]}),/*#__PURE__*/_jsx(\"span\",{children:label})]}),/*#__PURE__*/_jsxs(\"a\",{onMouseEnter:()=>setShowPreview(true),style:{color:previewTextColor,cursor:\"pointer\",textDecoration:\"none\",borderBottom:`1px solid transparent`,transition:\"border-color 0.2s ease\",display:hidePreviewOnMobile?\"none\":\"flex\",alignItems:\"center\",gap:6,...font},onMouseOver:e=>{e.currentTarget.style.borderBottomColor=previewTextColor;},onMouseOut:e=>{e.currentTarget.style.borderBottomColor=\"transparent\";},\"aria-label\":\"Preview PDF\",className:\"preview-link\",children:[/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 16 16\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 3C4.5 3 1.5 5.5 0.5 8C1.5 10.5 4.5 13 8 13C11.5 13 14.5 10.5 15.5 8C14.5 5.5 11.5 3 8 3ZM8 11C6.34 11 5 9.66 5 8C5 6.34 6.34 5 8 5C9.66 5 11 6.34 11 8C11 9.66 9.66 11 8 11ZM8 6.5C7.17 6.5 6.5 7.17 6.5 8C6.5 8.83 7.17 9.5 8 9.5C8.83 9.5 9.5 8.83 9.5 8C9.5 7.17 8.83 6.5 8 6.5Z\",fill:\"currentColor\"})}),previewLabel]})]}),showPreview&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:`rgba(0, 0, 0, ${dimmerOpacity})`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:overlayZIndex,padding:\"20px\",opacity:isAnimating?1:0,transition:`opacity ${animationDuration}ms ease`},onClick:()=>setShowPreview(false),onTransitionEnd:()=>{if(!showPreview)setIsAnimating(false);},children:/*#__PURE__*/_jsxs(\"div\",{style:{width:`${previewWidth}%`,height:`${previewHeight}%`,maxWidth:\"100%\",maxHeight:\"100%\",backgroundColor:\"#fff\",borderRadius:8,overflow:\"auto\",boxShadow:\"0 20px 60px rgba(0, 0, 0, 0.3)\",position:\"relative\",padding:overlayPadding,transform:isAnimating?\"scale(1)\":\"scale(0.9)\",opacity:isAnimating?1:0,transition:`all ${animationDuration}ms ease`},onClick:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>setShowPreview(false),style:{position:\"absolute\",top:12,right:12,width:32,height:32,borderRadius:\"50%\",backgroundColor:\"rgba(0, 0, 0, 0.6)\",border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:10,transition:\"background-color 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=\"rgba(0, 0, 0, 0.8)\";},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=\"rgba(0, 0, 0, 0.6)\";},\"aria-label\":\"Close preview\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 4L4 12M4 4L12 12\",stroke:\"white\",strokeWidth:\"2\",strokeLinecap:\"round\"})})}),props.previewImageFile?/*#__PURE__*/_jsx(\"img\",{src:props.previewImageFile,alt:\"Resume Preview\",style:{width:\"100%\",height:\"auto\",display:\"block\"}}):/*#__PURE__*/_jsx(\"iframe\",{src:pdfUrl,style:{width:\"100%\",height:\"100%\",border:\"none\"},title:\"PDF Preview\"})]})})]});}addPropertyControls(DownloadResumeButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Download Resume\"},previewLabel:{type:ControlType.String,title:\"Preview Label\",defaultValue:\"Preview\"},pdfUrl:{type:ControlType.String,title:\"PDF URL\",defaultValue:\"https://example.com/resume.pdf\",placeholder:\"Enter PDF URL...\"},fileName:{type:ControlType.String,title:\"File Name\",defaultValue:\"resume.pdf\",placeholder:\"resume.pdf\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\",defaultValue:\"#333333\"},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:\"#FFFFFF\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},previewImageFile:{type:ControlType.File,allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\"],title:\"Preview Image\"},overlayPadding:{type:ControlType.Number,title:\"Overlay Padding\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},buttonGap:{type:ControlType.Number,title:\"Button Gap\",defaultValue:12,min:0,max:50,step:1,unit:\"px\"},buttonPadding:{type:ControlType.String,title:\"Button Padding\",defaultValue:\"12px 24px\",placeholder:\"12px 24px\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:16,min:8,max:32,step:1,unit:\"px\"},previewTextColor:{type:ControlType.Color,title:\"Preview Text Color\",defaultValue:\"#000000\"},hidePreviewOnMobile:{type:ControlType.Boolean,title:\"Hide Preview on Mobile\",defaultValue:false,enabledTitle:\"Hidden\",disabledTitle:\"Visible\"},overlayZIndex:{type:ControlType.Number,title:\"Overlay Z-Index\",defaultValue:9999,min:0,max:99999,step:1},previewWidth:{type:ControlType.Number,title:\"Preview Width\",defaultValue:100,min:10,max:100,step:1,unit:\"%\"},previewHeight:{type:ControlType.Number,title:\"Preview Height\",defaultValue:100,min:10,max:100,step:1,unit:\"%\"},dimmerOpacity:{type:ControlType.Number,title:\"Dimmer Opacity\",defaultValue:.8,min:0,max:1,step:.1},animationDuration:{type:ControlType.Number,title:\"Animation Duration\",defaultValue:300,min:100,max:1e3,step:100,unit:\"ms\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DownloadResumeButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DownloadResumeButton.map"],"mappings":"sMAIG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,QAAM,eAAa,SAAO,WAAS,kBAAgB,YAAU,uBAAqB,iBAAe,eAAa,OAAK,QAAM,iBAAe,YAAU,gBAAc,WAAS,mBAAiB,sBAAoB,gBAAc,eAAa,gBAAc,gBAAc,qBAAmB,EAAW,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAO,MAAmB,CAAW,IAAS,QAAmB,EAAO,KAAK,EAAO,SAAS,EAAS,EAAgB,CAAC,kBAAgB,MAAM,EAAU,OAAO,OAAO,QAAQ,EAAc,OAAO,UAAU,WAAW,gBAAgB,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,IAAI,EAAE,GAAG,EAAK,CAAC,OAAoB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAM,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,SAAS,WAAW,QAAQ,OAAO,WAAW,SAAS,IAAI,EAAU,MAAM,cAAc,CAAC,SAAS,CAAc,EAAM,SAAS,CAAC,QAAQ,EAAe,MAAM,CAAC,GAAG,EAA6B,eAAa,CAAC,aAAa,GAAG,CAAC,EAAE,cAAc,MAAM,gBAAgB,EAAqB,EAAE,cAAc,MAAM,MAAM,GAAiB,aAAa,GAAG,CAAC,EAAE,cAAc,MAAM,g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