{"version":3,"file":"TitleVariableLastWord.CEb6ABqq.mjs","names":[],"sources":["https:/framerusercontent.com/modules/vxy2XZoW5LKW28QORNki/Huy0OfjDtdIaMqrIEqi4/TitleVariableLastWord.js"],"sourcesContent":["// Title component with adjustable last-word letterSpacing\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Title with variable letter spacing for last word\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */function TitleVariableLastWord(props){const{text,mainFont,lastFont,lastLetterSpacing,color,style}=props;// Split at last space\nconst parts=text.trim().split(\" \");const before=parts.slice(0,-1).join(\" \");const last=parts[parts.length-1];// Apply exposure (expo) to all words except the last, character by character, gradually\nfunction renderWithExpoRangeForWords(words,minExpo=-20,maxExpo=-80){const joined=words.join(\" \");const len=joined.length;if(len<2)return /*#__PURE__*/_jsx(\"span\",{style:{...mainFont,fontVariationSettings:`'EXPO' ${minExpo}`},children:joined});const expoStep=(maxExpo-minExpo)/(len-1);let charIndex=0;return /*#__PURE__*/_jsx(\"span\",{style:{...mainFont},children:words.map((word,wi)=>/*#__PURE__*/_jsxs(\"span\",{children:[wi>0&&\" \",word.split(\"\").map((ch,ci)=>{const expo=+(minExpo+expoStep*charIndex).toFixed(2);charIndex++;return /*#__PURE__*/_jsx(\"span\",{style:{fontVariationSettings:`'EXPO' ${expo}`},children:ch},ci);})]},wi))});}// Apply exposure (expo) to last word, character by character, gradually\nfunction renderLastWithExpo(word,minExpo=-80,maxExpo=-20){const len=word.length;if(len<2)return /*#__PURE__*/_jsx(\"span\",{style:{...mainFont,...lastFont,fontVariationSettings:`'EXPO' ${minExpo}`},children:word});const expoStep=(maxExpo-minExpo)/(len-1);return /*#__PURE__*/_jsx(\"span\",{style:{...mainFont,...lastFont},children:word.split(\"\").map((ch,i)=>{const expo=+(minExpo+expoStep*i).toFixed(2);return /*#__PURE__*/_jsx(\"span\",{style:{fontVariationSettings:`'EXPO' ${expo}`},children:ch},i);})});}return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"block\",width:\"100%\",color,...mainFont,...style},children:[before&&renderWithExpoRangeForWords(parts.slice(0,-1),props.firstExpoMin,props.firstExpoMax),before&&\" \",renderLastWithExpo(last,props.expoMin,props.expoMax)]});}addPropertyControls(TitleVariableLastWord,{text:{type:ControlType.String,title:\"Title\",defaultValue:\"Expo Title Variable\",placeholder:\"Your Title…\"},mainFont:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:40,variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}},lastFont:{type:ControlType.Font,title:\"Last Word Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:40,variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}},firstExpoMin:{type:ControlType.Number,title:\"First Expo Min\",defaultValue:-20,min:-80,max:-20,step:1},firstExpoMax:{type:ControlType.Number,title:\"First Expo Max\",defaultValue:-80,min:-80,max:-20,step:1},expoMin:{type:ControlType.Number,title:\"Expo Min\",defaultValue:-20,min:-80,max:-20,step:1},expoMax:{type:ControlType.Number,title:\"Expo Max\",defaultValue:-80,min:-80,max:-20,step:1},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000\"}});export default TitleVariableLastWord;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TitleVariableLastWord\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TitleVariableLastWord.map"],"mappings":"mKAMG,SAAS,EAAsB,EAAM,CAAC,GAAK,CAAC,OAAK,WAAS,WAAS,oBAAkB,QAAM,SAAO,EAC/F,EAAM,EAAK,MAAM,CAAC,MAAM,IAAI,CAAO,EAAO,EAAM,MAAM,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