{"version":3,"file":"NeonText.CQdFII4K.mjs","names":["useState","useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/1u2Ix622dlvg3WMq3yUE/asRPPAX5TX2Yj3XSG2bv/NeonText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{useState,useEffect,useRef}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// Вспомогательная функция для генерации уникального ID градиента\nconst useGradientId=()=>{const[id,setId]=React.useState(\"\");React.useEffect(()=>{setId(`textGradient-${Math.random().toString(36).substr(2,9)}`);},[]);return id;};// Измерение размера текста\nfunction useSize(ref){const[size,setSize]=useState({width:0,height:0});useEffect(()=>{if(!ref.current)return;const resizeObserver=new ResizeObserver(entries=>{for(let entry of entries){if(entry.contentRect){setSize({width:entry.contentRect.width,height:entry.contentRect.height});}}});resizeObserver.observe(ref.current);return()=>resizeObserver.disconnect();},[ref]);return size;}export default function SmileLogoText(props){const{word1,word2,fontSize,fontWeight,color1,color2,duration,strokeWidth}=props;const[isMobile,setIsMobile]=useState(false);const gradientId=useGradientId()// Генерируем ID для градиента\n;useEffect(()=>{// Защита от ошибки SSR (Server-Side Rendering) во Framer\nif(typeof window!==\"undefined\"){const handleResize=()=>{setIsMobile(window.innerWidth<=810);};handleResize();window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);}},[]);const currentStrokeWidth=isMobile?strokeWidth/2:strokeWidth;const textRef=useRef(null);const{width,height}=useSize(textRef);// Общие стили текста\nconst textStyles={fontSize:`${fontSize}px`,fontWeight:fontWeight,fontFamily:\"Inter, system-ui, sans-serif\",whiteSpace:\"nowrap\",letterSpacing:\"-0.02em\"};const pathLength=1500;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"inline-flex\",position:\"relative\",alignItems:\"center\",justifyContent:\"center\",...props.style},children:[/*#__PURE__*/_jsxs(\"div\",{ref:textRef,style:{...textStyles,color:\"transparent\",pointerEvents:\"none\"},children:[word1,\"\\xa0\",word2]}),width>0&&/*#__PURE__*/_jsxs(\"svg\",{width:width,height:height,viewBox:`0 0 ${width} ${height}`,style:{position:\"absolute\",top:0,left:0,overflow:\"visible\"},children:[/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"linearGradient\",{id:gradientId,x1:\"0%\",y1:\"0%\",x2:\"100%\",y2:\"0%\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:color1}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:color2})]})}),/*#__PURE__*/_jsxs(motion.text,{x:\"0\",y:\"50%\",dominantBaseline:\"central\",style:textStyles,fill:`url(#${gradientId})`,stroke:`url(#${gradientId})`,strokeWidth:currentStrokeWidth,strokeDasharray:pathLength,initial:{strokeDashoffset:pathLength,fillOpacity:0},animate:{strokeDashoffset:0,fillOpacity:1},transition:{strokeDashoffset:{duration:duration,ease:\"easeInOut\"},fillOpacity:{duration:duration*.5,delay:duration*.6,ease:\"easeIn\"}},children:[/*#__PURE__*/_jsx(\"tspan\",{children:word1}),/*#__PURE__*/_jsx(\"tspan\",{fill:\"transparent\",stroke:\"transparent\",children:\" \"}),/*#__PURE__*/_jsx(\"tspan\",{children:word2})]})]})]});}SmileLogoText.defaultProps={style:{width:\"auto\",height:\"auto\"}};addPropertyControls(SmileLogoText,{word1:{type:ControlType.String,title:\"Word 1\",defaultValue:\"Smile\"},word2:{type:ControlType.String,title:\"Word 2\",defaultValue:\"Systems\"},color1:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#FFC107\"},color2:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#6623B1\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:64,min:10,max:300},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:800,min:100,max:900,step:100},strokeWidth:{type:ControlType.Number,title:\"Line Thickness\",defaultValue:2,min:1,max:10},duration:{type:ControlType.Number,title:\"Speed (sec)\",defaultValue:2.5,min:.5,max:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmileLogoText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NeonText.map"],"mappings":"8PAEA,SAAS,EAAQ,EAAI,CAAC,GAAK,CAAC,EAAK,GAASA,EAAS,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAA0S,OAAzS,MAAc,CAAC,GAAG,CAAC,EAAI,QAAQ,OAAO,IAAM,EAAe,IAAI,eAAe,GAAS,CAAC,IAAI,IAAI,KAAS,EAAY,EAAM,aAAa,EAAQ,CAAC,MAAM,EAAM,YAAY,MAAM,OAAO,EAAM,YAAY,OAAO,CAAC,EAAK,CAAqC,OAApC,EAAe,QAAQ,EAAI,QAAQ,KAAW,EAAe,YAAY,EAAG,CAAC,EAAI,CAAC,CAAQ,EAAM,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,QAAM,WAAS,aAAW,SAAO,SAAO,WAAS,eAAa,EAAW,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAO,EAAW,GAAe,CACrkB,MAAc,CACf,GAAU,IAAS,OAAY,CAAC,IAAM,MAAiB,CAAC,EAAY,EAAO,YAAY,IAAI,EAAiE,OAA9D,GAAc,CAAC,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAAa,GAAI,EAAE,CAAC,CAAC,IAAM,EAAmB,EAAS,EAAY,EAAE,EAAkB,EAAQC,EAAO,KAAK,CAAM,CAAC,QAAM,UAAQ,EAAQ,EAAQ,CACpV,EAAW,CAAC,SAAS,GAAG,EAAS,IAAe,aAAW,WAAW,+BAA+B,WAAW,SAAS,cAAc,UAAU,CAAO,EAAW,KAAK,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,cAAc,SAAS,WAAW,WAAW,SAAS,eAAe,SAA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