{"version":3,"file":"Time_based_component.Dqo2UWab.mjs","names":[],"sources":["https:/framerusercontent.com/modules/iHfEKMDsYQeisWLbYUFr/CT6zyrfDgKRyuQVr15Ph/Time_based_component.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{Frame,addPropertyControls,ControlType}from\"framer\";// Define your time-based variant logic - - morning, afternoon, evening, night\nconst getVariantByTime=()=>{const hour=new Date().getHours()// Get current hour (0-23)\n;if(hour>=5&&hour<11){return\"morning\";}else if(hour>=11&&hour<18){return\"night\";}else if(hour>=18&&hour<21){return\"night\";}else{return\"night\";}};// The main component\nexport function TimeBasedComponent({morningImage,afternoonImage,eveningImage,nightImage,...rest}){// Dynamically choose the image based on the time of day\nconst currentVariant=getVariantByTime();const imageMap=[{key:\"morning\",src:morningImage},{key:\"afternoon\",src:afternoonImage},{key:\"evening\",src:eveningImage},{key:\"night\",src:nightImage}];const currentImage=imageMap.find(image=>image.key===currentVariant);return /*#__PURE__*/_jsx(Frame,{...rest,background:\"none\",children:currentImage&&/*#__PURE__*/_jsx(\"img\",{src:currentImage.src,alt:currentVariant,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\"}},currentImage.key)});}// Property Controls\naddPropertyControls(TimeBasedComponent,{morningImage:{type:ControlType.Image,title:\"Morning Image\"},afternoonImage:{type:ControlType.Image,title:\"Afternoon Image\"},eveningImage:{type:ControlType.Image,title:\"Evening Image\"},nightImage:{type:ControlType.Image,title:\"Night Image\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"TimeBasedComponent\":{\"type\":\"reactComponent\",\"name\":\"TimeBasedComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Time_based_component.map"],"mappings":"4OAGA,SAAgB,EAAmB,CAAC,eAAa,iBAAe,eAAa,aAAW,GAAG,EAAK,CAAC,CACjG,IAAM,EAAe,IAAyB,EAAS,CAAC,CAAC,IAAI,UAAU,IAAI,EAAa,CAAC,CAAC,IAAI,YAAY,IAAI,EAAe,CAAC,CAAC,IAAI,UAAU,IAAI,EAAa,CAAC,CAAC,IAAI,QAAQ,IAAI,EAAW,CAAC,CAAO,EAAa,EAAS,KAAK,GAAO,EAAM,MAAM,GAAgB,OAAoB,EAAK,EAAM,CAAC,GAAG,EAAK,WAAW,OAAO,SAAS,GAA2B,EAAK,MAAM,CAAC,IAAI,EAAa,IAAI,IAAI,EAAe,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,QAAQ,CAAC,CAAC,EAAa,KAAK,CAAG,yBAHxd,MAAqB,CAAC,IAAM,EAAK,IAAI,OAAO,WAC8E,OAA5H,GAAM,GAAG,EAAK,GAAU,UAA4C,OAAwE,EAGhJ,EAAoB,EAAmB,CAAC,aAAa,CAAC,KAAK,EAAY,MAAM,MAAM,gBAAgB,CAAC,eAAe,CAAC,KAAK,EAAY,MAAM,MAAM,kBAAkB,CAAC,aAAa,CAAC,KAAK,EAAY,MAAM,MAAM,gBAAgB,CAAC,WAAW,CAAC,KAAK,EAAY,MAAM,MAAM,cAAc,CAAC"}