{"version":3,"file":"CurrentTime.470PFUBV.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/64oZKbEHahwh5HFvQYol/LG71TwN2ogQbuf0uaN1F/CurrentTime.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{startTransition,useEffect,useState}from\"react\";import{motion}from\"framer\";import{addPropertyControls,ControlType}from\"framer\";const DESKTOP_FONT_SIZE=16;const TABLET_FONT_SIZE=16;const MOBILE_FONT_SIZE=14;export function CurrentTime(props){const{fontFamily,fontWeight,fontColor,letterSpacing,lineHeight,textAlign,textTransform,showTimeZone,timeFormat,showSeconds}=props;const[fontSize,setFontSize]=useState(MOBILE_FONT_SIZE);// Start empty so the server HTML and first client render match, then fill in after mount.\nconst[time,setTime]=useState(null);useEffect(()=>{if(typeof window!==\"undefined\"){const updateFontSize=()=>{const width=window.innerWidth;if(width>=1200){startTransition(()=>setFontSize(DESKTOP_FONT_SIZE));}else if(width>=810){startTransition(()=>setFontSize(TABLET_FONT_SIZE));}else{startTransition(()=>setFontSize(MOBILE_FONT_SIZE));}};updateFontSize();window.addEventListener(\"resize\",updateFontSize);return()=>window.removeEventListener(\"resize\",updateFontSize);}},[]);useEffect(()=>{startTransition(()=>setTime(new Date));const intervalId=setInterval(()=>{startTransition(()=>setTime(new Date));},1e3);return()=>clearInterval(intervalId);},[]);const timeStyles={fontFamily,fontSize:`${fontSize}px`,fontWeight,color:fontColor,letterSpacing:`${letterSpacing}em`,lineHeight:`${lineHeight}%`,textAlign,textTransform,padding:\"0\",margin:\"0\",fontVariantNumeric:\"slashed-zero\",fontFeatureSettings:\"'ss08' on, 'ss07' on\"};const timeInOslo=time===null?\"\":time.toLocaleString(\"en-US\",{timeZone:\"Europe/Oslo\",hour12:timeFormat===\"12h\",hour:\"numeric\",minute:\"numeric\",second:showSeconds?\"numeric\":undefined,timeZoneName:showTimeZone?\"short\":undefined});const placeholder=`00:00${showSeconds?\":00\":\"\"}${timeFormat===\"12h\"?\" AM\":\"\"}${showTimeZone?\" GMT+2\":\"\"}`;return /*#__PURE__*/_jsx(motion.div,{style:{display:\"flex\",justifyContent:\"flex-start\",alignItems:\"flex-start\"},children:/*#__PURE__*/_jsx(\"p\",{style:{...timeStyles,// Reserve the same space before the first tick to avoid layout shift.\nvisibility:time===null?\"hidden\":\"visible\"},suppressHydrationWarning:true,children:time===null?placeholder:timeInOslo})});}CurrentTime.defaultProps={fontFamily:\"PP Neue Montreal Mono Medium\",fontColor:\"#252525\",fontWeight:\"normal\",letterSpacing:0,lineHeight:100,textAlign:\"left\",textTransform:\"none\",showTimeZone:true,timeFormat:\"24h\",showSeconds:true};CurrentTime.displayName=\"Current Time\";addPropertyControls(CurrentTime,{fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:CurrentTime.defaultProps.fontFamily},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[\"normal\",\"bold\",\"bolder\",\"lighter\"],optionTitles:[\"Normal\",\"Bold\",\"Bolder\",\"Lighter\"],defaultValue:CurrentTime.defaultProps.fontWeight},fontColor:{type:ControlType.Color,title:\"Color\",defaultValue:CurrentTime.defaultProps.fontColor},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",defaultValue:CurrentTime.defaultProps.letterSpacing,unit:\"em\",step:.01},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:CurrentTime.defaultProps.lineHeight,unit:\"%\",step:1,min:50,max:200},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\",\"justify\"],optionTitles:[\"Left\",\"Center\",\"Right\",\"Justify\"],defaultValue:CurrentTime.defaultProps.textAlign},textTransform:{type:ControlType.Enum,title:\"Transform\",options:[\"none\",\"uppercase\",\"lowercase\",\"capitalize\"],optionTitles:[\"None\",\"Uppercase\",\"Lowercase\",\"Capitalize\"],defaultValue:CurrentTime.defaultProps.textTransform},showTimeZone:{title:\"Show Time Zone\",type:ControlType.Boolean,defaultValue:true},timeFormat:{title:\"Time Format\",type:ControlType.Enum,options:[\"12h\",\"24h\"],optionTitles:[\"12 Hour\",\"24 Hour\"],defaultValue:\"24h\"},showSeconds:{title:\"Show Seconds\",type:ControlType.Boolean,defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"CurrentTime\":{\"type\":\"reactComponent\",\"name\":\"CurrentTime\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CurrentTime.map"],"mappings":"gPAA+P,SAAgB,EAAY,EAAM,CAAC,GAAK,CAAC,aAAW,aAAW,YAAU,gBAAc,aAAW,YAAU,gBAAc,eAAa,aAAW,eAAa,EAAW,CAAC,EAAS,GAAaA,EAAS,CAAgB,EACpd,CAAC,EAAK,GAASA,EAAS,IAAI,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,MAAmB,CAAC,IAAM,EAAM,EAAO,WAA2B,EAAb,GAAO,SAA0B,EAAY,CAAiB,EAAY,GAAO,QAAyB,EAAY,CAAgB,MAA6B,EAAY,CAAgB,CAAC,CAAG,EAAoE,OAAlE,EAAe,EAAE,EAAO,iBAAiB,SAAS,CAAc,MAAY,EAAO,oBAAoB,SAAS,CAAc,CAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAc,CAAC,MAAoB,EAAQ,IAAI,IAAI,CAAC,EAAE,IAAM,EAAW,gBAAgB,CAAC,MAAoB,EAAQ,IAAI,IAAI,CAAC,CAAE,EAAE,GAAG,EAAE,UAAU,cAAc,CAAU,CAAE,EAAE,CAAC,CAAC,EAAE,IAAM,EAAW,CAAC,aAAW,SAAS,GAAG,EAAS,IAAI,aAAW,MAAM,EAAU,cAAc,GAAG,EAAc,IAAI,WAAW,GAAG,EAAW,GAAG,YAAU,gBAAc,QAAQ,IAAI,OAAO,IAAI,mBAAmB,eAAe,oBAAoB,sBAAsB,EAAQ,EAAW,IAAO,KAAK,GAAG,EAAK,eAAe,QAAQ,CAAC,SAAS,cAAc,OAAO,IAAa,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