{"version":3,"file":"RotatingText.C0B09nMA.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/R9roSbaSYXomwVshigR6/rNObieJWQe8sMzdmhNAs/RotatingText.js"],"sourcesContent":["// Rotating circular text component with customizable logo, direction, colors, and spacing\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Rotating Circular Text\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function RotatingText(props){const{text=\"GARAGE - WHERE DESIGN MEETS FUNCTION\",logo={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Logo\"},direction=\"clockwise\",speed=20,backgroundColor=\"#D4E5A3\",textColor=\"#000000\",logoGap=40,outerPadding=20,logoSize=30,font,style}=props;const canvasRef=useRef(null);const[rotation,setRotation]=useState(0);useEffect(()=>{const canvas=canvasRef.current;if(!canvas)return;const ctx=canvas.getContext(\"2d\");if(!ctx)return;const size=Math.min(style?.width,style?.height)||300;canvas.width=size;canvas.height=size;const centerX=size/2;const centerY=size/2;const radius=(size-outerPadding*2)/2-logoGap;ctx.clearRect(0,0,size,size);ctx.save();ctx.translate(centerX,centerY);ctx.rotate(rotation*Math.PI/180);const fontSize=parseInt(font.fontSize)||16;ctx.font=`${font.fontWeight||500} ${fontSize}px ${font.fontFamily||\"Inter\"}`;ctx.fillStyle=textColor;ctx.textAlign=\"center\";ctx.textBaseline=\"middle\";const characters=text.split(\"\");const angleStep=2*Math.PI/characters.length;characters.forEach((char,i)=>{const angle=i*angleStep-Math.PI/2;const x=Math.cos(angle)*radius;const y=Math.sin(angle)*radius;ctx.save();ctx.translate(x,y);ctx.rotate(angle+Math.PI/2);ctx.fillText(char,0,0);ctx.restore();});ctx.restore();},[rotation,text,textColor,font,outerPadding,style]);useEffect(()=>{const interval=setInterval(()=>{startTransition(()=>{setRotation(prev=>{const increment=direction===\"clockwise\"?speed/60:-speed/60;return(prev+increment)%360;});});},1e3/60);return()=>clearInterval(interval);},[direction,speed]);const size=Math.min((style?.width)||300,(style?.height)||300);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor,borderRadius:\"50%\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:logoSize,height:logoSize,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:1},children:/*#__PURE__*/_jsx(\"img\",{src:logo.src,alt:logo.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"contain\"}})})]});}addPropertyControls(RotatingText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"GARAGE - WHERE DESIGN MEETS FUNCTION\"},logo:{type:ControlType.ResponsiveImage,title:\"Logo\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"clockwise\",\"counterclockwise\"],optionTitles:[\"→\",\"←\"],defaultValue:\"clockwise\",displaySegmentedControl:true},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:20,min:1,max:100,step:1},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#D4E5A3\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"0.05em\"}},logoSize:{type:ControlType.Number,title:\"Logo Size\",defaultValue:30,min:10,max:200,step:1,unit:\"px\"},logoGap:{type:ControlType.Number,title:\"Logo Gap\",defaultValue:40,min:0,max:100,step:1,unit:\"px\"},outerPadding:{type:ControlType.Number,title:\"Outer Padding\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RotatingText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"300\",\"framerIntrinsicWidth\":\"300\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RotatingText.map"],"mappings":"sMASG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,uCAAuC,OAAK,CAAC,IAAI,sEAAsE,IAAI,MAAM,EAAE,YAAU,YAAY,QAAM,GAAG,kBAAgB,UAAU,YAAU,UAAU,UAAQ,GAAG,eAAa,GAAG,WAAS,GAAG,OAAK,SAAO,EAAY,EAAUA,EAAO,IAAI,EAAO,CAAC,EAAS,GAAaC,EAAS,CAAC,EAA8uC,OAA5uC,MAAc,CAAC,IAAM,EAAO,EAAU,QAAQ,GAAG,CAAC,EAAO,OAAO,IAAM,EAAI,EAAO,WAAW,IAAI,EAAE,GAAG,CAAC,EAAI,OAAO,IAAM,EAAK,KAAK,IAAI,GAAO,MAAM,GAAO,MAAM,GAAG,IAAI,EAAO,MAAM,EAAK,EAAO,OAAO,EAAK,IAAM,EAAQ,EAAK,EAAQ,EAAQ,EAAK,EAAQ,GAAQ,EAAK,EAAa,GAAG,EAAE,EAAQ,EAAI,UAAU,EAAE,EAAE,EAAK,CAAI,EAAE,EAAI,KAAK,EAAE,EAAI,UAAU,EAAQ,CAAO,EAAE,EAAI,OAAO,EAAS,KAAK,GAAG,GAAG,EAAE,IAAM,EAAS,SAAS,EAAK,QAAQ,GAAG,GAAG,EAAI,KAAK,GAAG,EAAK,YAAY,IAAI,GAAG,EAAS,KAAK,EAAK,YAAY,UAAU,EAAI,UAAU,EAAU,EAAI,UAAU,SAAS,EAAI,aAAa,SAAS,IAAM,EAAW,EAAK,MAAM,EAAE,EAAQ,EAA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