{"version":3,"file":"ScrubText.3MIkYMq4.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/rPIxe52Vt8kEQwbyRR6O/303ALDcM4UZ5Q29AJAB7/ScrubText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useScroll,useTransform}from\"framer-motion\";import{useRef}from\"react\";function Word({word,i,n,progress,color,dim,accent}){const start=i/n;const end=Math.min(1,start+1.5/n);const opacity=useTransform(progress,[start,end],[.16,1]);return /*#__PURE__*/_jsxs(\"span\",{style:{position:\"relative\",display:\"inline-block\",marginRight:\"0.24em\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:dim,position:\"absolute\",inset:0,opacity:0},children:word}),/*#__PURE__*/_jsx(motion.span,{style:{opacity,color:accent?\"inherit\":color,fontStyle:accent?\"italic\":undefined},children:word})]});}/**\n * Scrub Text — words light up one by one as the reader scrolls.\n * Words listed in Highlight are set in italic accent colour.\n *\n * @framerIntrinsicWidth 900\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function ScrubText(props){const{text=\"Golf is only part of the STRYV\\xc9N experience.\",highlight=\"STRYV\\xc9N\",color=\"#F2F0EA\",dimColor=\"#504E49\",accentColor=\"#FF5B1F\",font}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();const{scrollYProgress}=useScroll({target:ref,offset:[\"start 0.9\",\"end 0.45\"]});const words=text.split(/\\s+/).filter(Boolean);const hl=highlight.split(\",\").map(s=>s.trim().toLowerCase()).filter(Boolean);const isAccent=w=>hl.some(h=>w.toLowerCase().replace(/[.,—–!?;:]/g,\"\").includes(h));return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",margin:0,...font,...props.style,height:\"auto\"},children:/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color},children:words.map((w,i)=>{const accent=isAccent(w);if(isStatic)return /*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",marginRight:\"0.24em\",color:accent?accentColor:i<words.length*.55?color:dimColor,fontStyle:accent?\"italic\":undefined},children:w},i);return /*#__PURE__*/_jsx(\"span\",{style:{color:accent?accentColor:undefined},children:/*#__PURE__*/_jsx(Word,{word:w,i:i,n:words.length,progress:scrollYProgress,color:color,dim:dimColor,accent:accent})},i);})})});}addPropertyControls(ScrubText,{text:{type:ControlType.String,displayTextArea:true,defaultValue:\"Golf is only part of the STRYV\\xc9N experience.\"},highlight:{type:ControlType.String,defaultValue:\"STRYV\\xc9N\",description:\"Comma separated words set in italic accent\"},color:{type:ControlType.Color,defaultValue:\"#F2F0EA\"},dimColor:{type:ControlType.Color,defaultValue:\"#504E49\"},accentColor:{type:ControlType.Color,defaultValue:\"#FF5B1F\"},font:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"64px\",variant:\"Medium\",letterSpacing:\"-0.04em\",lineHeight:\"1.05em\",textAlign:\"left\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrubText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"900\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrubText.map"],"mappings":"yPAAoN,SAAS,EAAK,CAAC,OAAK,IAAE,IAAE,WAAS,QAAM,MAAI,UAAQ,CAAC,IAAM,EAAM,EAAE,EAA0C,EAAQ,EAAa,EAAS,CAAC,EAA7D,KAAK,IAAI,EAAE,EAAM,IAAI,CAAgD,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,OAAoB,EAAM,OAAO,CAAC,MAAM,CAAC,SAAS,WAAW,QAAQ,eAAe,YAAY,QAAQ,EAAE,SAAS,CAAc,EAAK,OAAO,CAAC,MAAM,CAAC,MAAM,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