{"version":3,"file":"FooterStatus.B83rivth.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/RNps0pDgKFTxTF4PLE4f/jlyzWdSJRrGClWYevmFj/FooterStatus.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const INTER='@import url(\"https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..700&display=swap\");';const STATUS={online:{label:\"Online\",color:\"#8af54d\"},idle:{label:\"Idle\",color:\"#f0b23d\"},dnd:{label:\"Online\",color:\"#8af54d\"},offline:{label:\"Offline\",color:\"#6b6b6b\"}};/** What you're up to, from your Discord activities. */function activityText(data){if(!data)return\"\";const custom=data.activities.find(a=>a.type===4&&a.state);if(custom?.state)return custom.state;const a=data.activities.find(x=>x.type!==4);if(!a)return\"\";const verb=a.type===2?\"Listening to\":a.type===3?\"Watching\":a.type===1?\"Streaming\":\"Playing\";return`${verb} ${a.name}`;}/**\n * Footer Status\n *\n * @framerIntrinsicWidth 867\n * @framerIntrinsicHeight 30\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function FooterStatus(props){const{discordId=\"1213478713765666857\",timeZone=\"Europe/London\",place=\"England\",align=\"spread\",fontSize=22.1,style}=props;const isStatic=useIsStaticRenderer();const[now,setNow]=useState(()=>new Date);const[data,setData]=useState(null);useEffect(()=>{if(isStatic)return;const id=window.setInterval(()=>setNow(new Date),1e3);return()=>window.clearInterval(id);},[isStatic]);useEffect(()=>{if(isStatic||!discordId)return;let stopped=false;const load=async()=>{try{const res=await fetch(`https://api.lanyard.rest/v1/users/${discordId}`);const json=await res.json();if(!stopped&&json?.success)setData(json.data);}catch{// keep the last status we had\n}};load();const id=window.setInterval(load,2e4);return()=>{stopped=true;window.clearInterval(id);};},[isStatic,discordId]);const time=now.toLocaleTimeString(\"en-GB\",{timeZone,hour:\"2-digit\",minute:\"2-digit\"});// On the canvas, show it as online so the design reads right\nconst status=STATUS[isStatic?\"online\":data?.discord_status??\"offline\"];const activity=activityText(data);const muted=\"var(--token-42cc228f-9a1f-47ee-93d2-14a4d390285d, rgb(161, 161, 161))\";return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"flex\",flexWrap:\"wrap\",alignItems:\"center\",justifyContent:align===\"center\"?\"center\":\"space-between\",gap:\"0.4em 1.4em\",fontSize,fontWeight:500,lineHeight:1.2,fontFamily:'\"Inter\", \"Inter Placeholder\", sans-serif',fontVariationSettings:'\"opsz\" 32',color:muted,textAlign:align===\"center\"?\"center\":\"left\"},children:[/*#__PURE__*/_jsx(\"style\",{children:INTER}),/*#__PURE__*/_jsxs(\"span\",{children:[/*#__PURE__*/_jsx(\"span\",{style:{color:\"var(--token-d7398386-7806-48a8-bc9f-fb1777d716ea, rgba(255, 255, 255, 0.75))\",fontVariantNumeric:\"tabular-nums\"},children:time}),\" \",\"in \",place]}),/*#__PURE__*/_jsxs(\"span\",{style:{display:\"inline-flex\",alignItems:\"center\",gap:\"0.45em\"},children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{width:\"0.5em\",height:\"0.5em\",borderRadius:\"50%\",background:status.color,boxShadow:`0 0 0.4em ${status.color}66`}}),/*#__PURE__*/_jsx(\"span\",{children:/*#__PURE__*/_jsx(\"span\",{style:{color:\"var(--token-d7398386-7806-48a8-bc9f-fb1777d716ea, rgba(255, 255, 255, 0.75))\"},children:status.label})})]})]});}addPropertyControls(FooterStatus,{discordId:{type:ControlType.String,title:\"Discord ID\",defaultValue:\"1213478713765666857\"},timeZone:{type:ControlType.String,title:\"Time Zone\",defaultValue:\"Europe/London\"},place:{type:ControlType.String,title:\"Place\",defaultValue:\"England\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"spread\",\"center\"],optionTitles:[\"Spread\",\"Center\"],defaultValue:\"spread\",displaySegmentedControl:true},fontSize:{type:ControlType.Number,title:\"Text Size\",defaultValue:22.1,min:8,max:60,step:.1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FooterStatus\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"30\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"867\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FooterStatus.map"],"mappings":"mMAA4f,SAAS,EAAa,EAAK,CAAC,GAAG,CAAC,EAAK,MAAM,GAAG,IAAM,EAAO,EAAK,WAAW,KAAK,GAAG,EAAE,OAAO,GAAG,EAAE,KAAK,EAAE,GAAG,GAAQ,MAAM,OAAO,EAAO,MAAM,IAAM,EAAE,EAAK,WAAW,KAAK,GAAG,EAAE,OAAO,CAAC,EAA6G,OAAvG,EAA6G,GAAvF,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,UAAwB,GAAG,EAAE,OAAlH,EAAyH,CAQvzB,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,YAAU,sBAAsB,WAAS,gBAAgB,QAAM,UAAU,QAAM,SAAS,WAAS,KAAK,SAAO,EAAY,EAAS,EAAoB,EAAO,CAAC,EAAI,GAAQA,MAAa,IAAI,IAAI,EAAO,CAAC,EAAK,GAASA,EAAS,IAAI,EAAE,MAAc,CAAC,GAAG,EAAS,OAAO,IAAM,EAAG,EAAO,gBAAgB,EAAO,IAAI,IAAI,EAAE,GAAG,EAAE,UAAU,EAAO,cAAc,CAAE,CAAE,EAAE,CAAC,CAAQ,CAAC,EAAE,MAAc,CAAC,GAAG,GAAU,CAAC,EAAU,OAAO,IAAI,EAAQ,GAAY,EAAK,SAAS,CAAC,GAAG,CAAyE,IAAM,EAAK,MAAM,MAAzE,MAAM,qCAAqC,GAAW,EAAA,CAAuB,K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