{"version":3,"file":"StudioTime.CBj0siBd.mjs","names":["p","useRef","useState","c","__esmMin","init_ssg_sandbox_shims","window","_e","de","p","init_npm_react_18_3_1","ce","addPropertyControls","RenderTarget","init_framer_BCdLsbZT","ControlType","now","tz","Digit","props","d","reduce","ms","UI","delay","i","StudioTime","p$1","isCanvas","root","time","setTime","first","setFirst","setReduce","mq","el","tick","every","start","io","chars","place","c$1","k","init_StudioTime","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/ngq115UdpUo1DLS7S6MQ/pydDmsGv4m5eqMyRRZ8Y/StudioTime.js"],"sourcesContent":["// Studio Time: \"It's 14:32 in Antwerp.\"\n// The studio's local time as a sentence. The first time the line comes into view its digits roll up from 00:00 to\n// the time, like an odometer, and after that each changed digit turns over on the minute.\n// Written for Creativo (Team Pixel, 2026).\n// The rolling digits follow the idea of Motion Primitives' Sliding Number, rebuilt from scratch on Creativo's curves\n// (no code copied). Credit, with their MIT notice: Copyright (c) 2024 ibelick. Permission is hereby granted, free of\n// charge, to any person obtaining a copy of this software ... THE SOFTWARE IS PROVIDED \"AS IS\".\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const UI=\"cubic-bezier(.22,1,.36,1)\"// creativo.ui\n;function now(tz){try{return new Intl.DateTimeFormat(\"en-GB\",{hour:\"2-digit\",minute:\"2-digit\",hour12:false,timeZone:tz||undefined}).format(new Date);}catch(e){return new Intl.DateTimeFormat(\"en-GB\",{hour:\"2-digit\",minute:\"2-digit\",hour12:false}).format(new Date);}}// one digit place: a column 0 to 9 that slides to the digit, so a change from 0 to 4 rolls through 1, 2 and 3\nfunction Digit(props){const{d,delay,reduce,ms}=props;return /*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",height:\"1.3em\",overflow:\"hidden\",verticalAlign:\"top\"},children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",transform:`translateY(${(-d*1.3).toFixed(2)}em)`,transition:reduce?\"none\":`transform ${ms}ms ${UI} ${delay}ms`},children:[0,1,2,3,4,5,6,7,8,9].map(i=>/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",height:\"1.3em\"},children:i},i))})});}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function StudioTime(props){const p=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const root=useRef(null);const[time,setTime]=useState(isCanvas?now(p.timeZone):\"00:00\");const[first,setFirst]=useState(true);const[reduce,setReduce]=useState(false);useEffect(()=>{if(isCanvas)return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");setReduce(mq.matches);const el=root.current;let tick=0,every=0;const start=()=>{setTime(now(p.timeZone));const ms=6e4-Date.now()%6e4+50;tick=setTimeout(()=>{setFirst(false);setTime(now(p.timeZone));every=setInterval(()=>setTime(now(p.timeZone)),6e4);},ms);};if(!el||mq.matches){start();return()=>{clearTimeout(tick);clearInterval(every);};}// roll up to the time the first time the line is seen\nconst io=new IntersectionObserver(([e])=>{if(!e.isIntersecting)return;io.disconnect();start();},{threshold:.6});io.observe(el);return()=>{io.disconnect();clearTimeout(tick);clearInterval(every);};},[isCanvas,p.timeZone]);const chars=time.split(\"\");let place=0;return /*#__PURE__*/_jsxs(\"span\",{ref:root,style:{...p.style,display:\"inline-block\",whiteSpace:\"nowrap\",fontFamily:`\"${p.font}\", sans-serif`,fontSize:p.size,fontWeight:p.weight,lineHeight:\"1.3em\",color:p.color,fontVariantNumeric:\"tabular-nums\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",width:1,height:1,overflow:\"hidden\",clip:\"rect(0 0 0 0)\",whiteSpace:\"nowrap\"},children:`${p.before} ${time} in ${p.city}${p.after}`}),/*#__PURE__*/_jsxs(\"span\",{\"aria-hidden\":\"true\",children:[p.before,\" \",chars.map((c,i)=>{if(c<\"0\"||c>\"9\")return /*#__PURE__*/_jsx(\"span\",{children:c},i);const k=place++;return /*#__PURE__*/_jsx(Digit,{d:Number(c),delay:first?120+k*90:0,ms:first?1100:700,reduce:reduce||isCanvas},i);}),` in ${p.city}${p.after}`]})]});}StudioTime.displayName=\"Studio Time\";addPropertyControls(StudioTime,{before:{type:ControlType.String,title:\"Before\",defaultValue:\"It’s\"},city:{type:ControlType.String,title:\"City\",defaultValue:\"Antwerp\"},after:{type:ControlType.String,title:\"After\",defaultValue:\".\"},timeZone:{type:ControlType.String,title:\"Time zone\",defaultValue:\"Europe/Brussels\",description:\"IANA name, e.g. Europe/London, Australia/Melbourne\"},font:{type:ControlType.String,title:\"Font\",defaultValue:\"Host Grotesk\"},size:{type:ControlType.Number,title:\"Size\",min:12,max:120,step:1,unit:\"px\",defaultValue:20},weight:{type:ControlType.Number,title:\"Weight\",min:100,max:900,step:10,defaultValue:400},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StudioTime\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StudioTime.map"],"mappings":"A,2MAQC,SAASgB,EAAI,EAAG,CAAC,GAAG,CAAC,OAAO,IAAI,KAAK,eAAe,QAAQ,CAAC,KAAK,UAAU,OAAO,UAAU,OAAO,GAAM,SAASC,GAAI,IAAA,EAAS,CAAC,CAAC,CAAC,uBAAO,IAAI,IAAI,CAAE,MAAS,CAAC,OAAO,IAAI,KAAK,eAAe,QAAQ,CAAC,KAAK,UAAU,OAAO,UAAU,OAAO,EAAK,CAAC,CAAC,CAAC,uBAAO,IAAI,IAAI,CAAE,CAAC,CACxQ,SAASC,EAAM,EAAM,CAAC,GAAK,CAAC,IAAE,QAAM,SAAO,MAAIC,EAAM,MAAoB,gBAAK,OAAO,CAAC,MAAM,CAAC,Q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