{"version":3,"file":"ShineText.CfXpVuLU.mjs","names":["React.useId"],"sources":["https:/framerusercontent.com/modules/njN50pl1eknE10wtxzMY/7jWJwNjvFPyH4MOVwThm/ShineText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const DEFAULT_PROPS={text:\"Shine Text\",font:{fontFamily:\"Oswald\",fontSize:113,fontWeight:700,lineHeight:\"1.1em\",letterSpacing:\"-0.03em\",textAlign:\"left\"},textColor:\"#111111\",shineColor:\"#FFFFFF\",shineOpacity:.85,shineWidth:16,shineSoftness:8,shineAngle:105,sweepDuration:1.2,interval:2.6,direction:\"leftToRight\"};function clamp(value,min,max){return Math.min(Math.max(value,min),max);}function createSafeId(value){return value.replace(/[^a-zA-Z0-9_-]/g,\"_\");}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ShineText(props){const{text,font,textColor,shineColor,shineOpacity,shineWidth,shineSoftness,shineAngle,sweepDuration,interval,direction,style}=props;const instanceId=React.useId().replace(/:/g,\"\");const safeSweepDuration=Math.max(.2,sweepDuration);const safeInterval=Math.max(0,interval);const totalDuration=safeSweepDuration+safeInterval;const sweepEndPercent=clamp(safeSweepDuration/totalDuration*100,1,100);const safeShineWidth=clamp(shineWidth,4,80);const safeShineSoftness=clamp(shineSoftness,0,40);const safeShineOpacity=clamp(shineOpacity,0,1);const safeShineAngle=clamp(shineAngle,0,180);const startPosition=direction===\"leftToRight\"?\"220%\":\"-120%\";const endPosition=direction===\"leftToRight\"?\"-120%\":\"220%\";const halfWidth=safeShineWidth/2;const animationSignature=createSafeId([safeSweepDuration,safeInterval,safeShineWidth,safeShineSoftness,safeShineAngle,direction].join(\"_\"));const rootClassName=`shineText_${instanceId}`;const animationName=`shineTextSweep_${instanceId}_${animationSignature}`;const shineGradient=`linear-gradient(\n        ${safeShineAngle}deg,\n        transparent 0%,\n        transparent ${clamp(50-halfWidth-safeShineSoftness,0,100)}%,\n        rgba(0, 0, 0, 0.25) ${clamp(50-halfWidth,0,100)}%,\n        rgba(0, 0, 0, 1) 50%,\n        rgba(0, 0, 0, 0.25) ${clamp(50+halfWidth,0,100)}%,\n        transparent ${clamp(50+halfWidth+safeShineSoftness,0,100)}%,\n        transparent 100%\n    )`;const textLayerStyle={...font,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",margin:0};const shineLayerStyle={...textLayerStyle,position:\"absolute\",inset:0,display:\"block\",color:shineColor,opacity:safeShineOpacity,pointerEvents:\"none\",WebkitMaskImage:shineGradient,maskImage:shineGradient,WebkitMaskSize:\"260% 100%\",maskSize:\"260% 100%\",WebkitMaskRepeat:\"no-repeat\",maskRepeat:\"no-repeat\",animationName,animationDuration:`${totalDuration}s`,animationTimingFunction:\"ease-in-out\",animationIterationCount:\"infinite\",animationFillMode:\"both\",willChange:\"mask-position, -webkit-mask-position\"};return /*#__PURE__*/_jsxs(\"div\",{className:rootClassName,style:{...style,position:\"relative\",display:\"block\",width:\"100%\",overflow:\"hidden\",color:textColor},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes ${animationName} {\n                    0% {\n                        -webkit-mask-position: ${startPosition} 0;\n                        mask-position: ${startPosition} 0;\n                    }\n\n                    ${sweepEndPercent}% {\n                        -webkit-mask-position: ${endPosition} 0;\n                        mask-position: ${endPosition} 0;\n                    }\n\n                    100% {\n                        -webkit-mask-position: ${endPosition} 0;\n                        mask-position: ${endPosition} 0;\n                    }\n                }\n\n                @media (prefers-reduced-motion: reduce) {\n                    .${rootClassName} .shine-text-highlight {\n                        animation: none !important;\n                        opacity: 0 !important;\n                    }\n                }\n            `}),/*#__PURE__*/_jsx(\"span\",{style:{...textLayerStyle,position:\"relative\",display:\"block\",color:textColor},children:text}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",className:\"shine-text-highlight\",style:shineLayerStyle,children:text},animationName)]});}ShineText.defaultProps=DEFAULT_PROPS;addPropertyControls(ShineText,{text:{type:ControlType.String,title:\"Text\",defaultValue:DEFAULT_PROPS.text,displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",defaultValue:DEFAULT_PROPS.font,controls:\"extended\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:DEFAULT_PROPS.textColor},shineColor:{type:ControlType.Color,title:\"Shine\",defaultValue:DEFAULT_PROPS.shineColor},shineOpacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:DEFAULT_PROPS.shineOpacity,min:0,max:1,step:.05},shineWidth:{type:ControlType.Number,title:\"Width\",defaultValue:DEFAULT_PROPS.shineWidth,min:4,max:80,step:1,unit:\"%\"},shineSoftness:{type:ControlType.Number,title:\"Softness\",defaultValue:DEFAULT_PROPS.shineSoftness,min:0,max:40,step:1,unit:\"%\"},shineAngle:{type:ControlType.Number,title:\"Angle\",defaultValue:DEFAULT_PROPS.shineAngle,min:0,max:180,step:1,unit:\"\\xb0\"},sweepDuration:{type:ControlType.Number,title:\"Sweep\",defaultValue:DEFAULT_PROPS.sweepDuration,min:.2,max:8,step:.1,unit:\"s\"},interval:{type:ControlType.Number,title:\"Interval\",defaultValue:DEFAULT_PROPS.interval,min:0,max:12,step:.1,unit:\"s\"},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:DEFAULT_PROPS.direction,options:[\"leftToRight\",\"rightToLeft\"],optionTitles:[\"Left → Right\",\"Right → Left\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShineText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ShineText.map"],"mappings":"iLAAkc,SAAS,EAAM,EAAM,EAAI,EAAI,CAAC,OAAO,KAAK,IAAI,KAAK,IAAI,EAAM,CAAG,EAAE,CAAG,CAAE,CAAC,SAAS,EAAa,EAAM,CA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