{"version":3,"file":"Text_Opacity_Letters.BFe6McJa.mjs","names":["React.useState","useRef"],"sources":["https:/framerusercontent.com/modules/2ml0ZLEKftLZfA4ksxoV/suZjMKFmFrnBuRIhWCTV/neoBrutalismButton.js","https:/framerusercontent.com/modules/XCcAKM5KFonLG9ZK02Aq/m7V2nFn7WA9fxW0Ao1e9/Text_Opacity_Letters.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Regex for external domains (with or without protocol)\nconst domainRegex=/^[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}([\\/?#].*)?$/;/**\n * Neo-Brutalism Button\n *\n * @framerDisableUnlink\n *\n */export default function NeoBrutalismButton(props){const{text,backgroundColor,textColor,borderColor,shadowColor,borderWidth,shadowOffset,font,link,padding}=props;const[isPressed,setIsPressed]=React.useState(false);const[isHovered,setIsHovered]=React.useState(false);// Determine link type\nlet href=link||\"#\";let isExternal=false;if(href.startsWith(\"http://\")||href.startsWith(\"https://\")||href.startsWith(\"//\")||href.startsWith(\"www.\")||domainRegex.test(href)){isExternal=true;// Prepend protocol if not present\nif(!/^https?:\\/\\//i.test(href)&&!href.startsWith(\"//\")){href=\"https://\"+href;}}const getTransform=()=>{if(isPressed)return`translate(${shadowOffset}px, ${shadowOffset}px)`;if(isHovered)return`translate(${shadowOffset*.3}px, ${shadowOffset*.3}px)`;return\"translate(0px, 0px)\";};const getShadow=()=>{if(isPressed)return\"none\";if(isHovered)return`${shadowOffset*.7}px ${shadowOffset*.7}px 0px ${shadowColor}`;return`${shadowOffset}px ${shadowOffset}px 0px ${shadowColor}`;};return /*#__PURE__*/_jsx(\"a\",{href:href,target:isExternal?\"_blank\":undefined,rel:isExternal?\"noopener noreferrer\":undefined,style:{display:\"inline-block\",textDecoration:\"none\",position:\"relative\",backgroundColor,color:textColor,border:`${borderWidth}px solid ${borderColor}`,padding,cursor:\"pointer\",userSelect:\"none\",outline:\"none\",transition:\"none\",transform:getTransform(),boxShadow:getShadow(),minWidth:\"max-content\",...font},onMouseDown:()=>setIsPressed(true),onMouseUp:()=>setIsPressed(false),onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>{setIsPressed(false);setIsHovered(false);},tabIndex:0,// optional: make it accessible as button\nrole:\"button\",children:text});}addPropertyControls(NeoBrutalismButton,{text:{type:ControlType.String,title:\"Button Text\",defaultValue:\"CLICK ME\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#FF0080\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#000000\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:4,min:1,max:10,step:1,unit:\"px\"},padding:{type:ControlType.Padding,defaultValue:\"16px 32px 16px 32px\"},shadowColor:{type:ControlType.Color,title:\"Shadow Color\",defaultValue:\"#000000\"},shadowOffset:{type:ControlType.Number,title:\"Shadow Offset\",defaultValue:8,min:2,max:20,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"18px\",variant:\"Bold\",letterSpacing:\"0.02em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},link:{type:ControlType.Link,defaultValue:\"\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NeoBrutalismButton\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./neoBrutalismButton.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useScroll,useTransform}from\"framer-motion\";import{useRef,useEffect}from\"react\";const EachCharacter=({char,start,end,progress,duration,easing,index,transitionStartIndex})=>{const colorProgress=useTransform(progress,[start,end],[\"#666666\",\"#FFFFFF\"]);const initialColor=index<transitionStartIndex?\"#FFFFFF\":\"#666666\";return /*#__PURE__*/_jsx(motion.span,{style:{color:index<transitionStartIndex?initialColor:colorProgress},transition:{duration:duration,ease:easing},children:char});};const EachWord=({word,progress,starting,ending,duration,easing,transitionStartIndex,currentCharacterIndex})=>{const characters=word.split(\"\");const wordLength=word.length;const amount=ending-starting;const step=amount/wordLength;return /*#__PURE__*/_jsxs(motion.span,{children:[characters.map((char,idx)=>{const charStart=starting+step*idx;const charEnd=starting+step*(idx+1);return /*#__PURE__*/_jsx(EachCharacter,{char:char,start:charStart,end:charEnd,progress:progress,duration:duration,easing:easing,index:currentCharacterIndex+idx,transitionStartIndex:transitionStartIndex},idx);}),\"\\xa0\"]});};export default function Text_Color_Letters(props){const{text,duration,easing,fontSize,lineHeight,letterSpacing,paragraphAlign,transitionStartIndex,fontFamily,fontWeight}=props;const words=text.split(\" \");const totalWords=words.length;const ref=useRef(null);const{scrollYProgress}=useScroll({target:ref,offset:[\"start 0.75\",\"start 0.15\"]});useEffect(()=>{const style=document.createElement(\"style\");style.appendChild(document.createTextNode(`\n            @import url('https://fonts.googleapis.com/css2?family=${fontFamily.replace(/ /g,\"+\")}:wght@400;500;700&display=swap');\n        `));document.head.appendChild(style);return()=>{document.head.removeChild(style);};},[fontFamily]);let currentCharacterIndex=0;return /*#__PURE__*/_jsx(\"p\",{ref:ref,style:{fontFamily:`${fontFamily}, sans-serif`,fontSize:`${fontSize}px`,fontWeight:fontWeight,color:\"#666666\",display:\"flex\",flexWrap:\"wrap\",lineHeight:`${lineHeight}px`,letterSpacing:`${letterSpacing}px`,justifyContent:paragraphAlign,margin:0},children:words.map((word,idx)=>{const starting=idx/totalWords;const ending=(idx+1)/totalWords;const wordLength=word.length;const startIdx=currentCharacterIndex;currentCharacterIndex+=wordLength+1// Including space\n;return /*#__PURE__*/_jsx(EachWord,{word:word,progress:scrollYProgress,starting:starting,ending:ending,duration:duration,easing:easing,transitionStartIndex:transitionStartIndex,currentCharacterIndex:startIdx},idx);})});}addPropertyControls(Text_Color_Letters,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Hello Text\"},fontFamily:{title:\"Font Family\",type:ControlType.String,defaultValue:\"Urbanist\"},fontSize:{title:\"Font Size\",type:ControlType.Number,defaultValue:48,min:10,max:100},fontWeight:{title:\"Font Weight\",type:ControlType.Enum,options:[\"400\",\"500\",\"700\"],optionTitles:[\"Regular\",\"Medium\",\"Bold\"],defaultValue:\"400\"},lineHeight:{title:\"Line Height\",type:ControlType.Number,defaultValue:60,min:10,max:100},letterSpacing:{title:\"Letter Spacing\",type:ControlType.Number,defaultValue:-3,min:-10,max:10},paragraphAlign:{title:\"Paragraph Align\",type:ControlType.Enum,options:[\"flex-start\",\"center\",\"flex-end\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"},duration:{title:\"Duration\",type:ControlType.Number,defaultValue:.3,min:.1,max:3,step:.1},easing:{title:\"Easing\",type:ControlType.Enum,options:[\"easeInOut\",\"easeIn\",\"easeOut\",\"linear\"],optionTitles:[\"Ease In Out\",\"Ease In\",\"Ease Out\",\"Linear\"],defaultValue:\"easeInOut\"},transitionStartIndex:{title:\"Transition Start Index\",type:ControlType.Number,defaultValue:22,min:0,max:1e3}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Text_Color_Letters\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Opacity_Letters.map"],"mappings":"8PAMG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,kBAAgB,YAAU,cAAY,cAAY,cAAY,eAAa,OAAK,OAAK,WAAS,EAAW,CAAC,EAAU,GAAcA,EAAe,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAe,EAAK,EACtQ,EAAK,GAAM,IAAQ,EAAW,GACqb,OAD5a,EAAK,WAAW,SAAS,GAAG,EAAK,WAAW,UAAU,GAAG,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