{"version":3,"file":"P25ScrollStatement.BYe_6pMn.mjs","names":["React.useRef","React.useState","React.useMemo","__esmMin","le","init_ssg_sandbox_shims","_e","pe","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","window","addPropertyControls","RenderTarget","init_framer_Bf4_tcb2","ControlType","P25ScrollStatement","props","isCanvas","ref","w","setW","words","text","keys","highlight","s","wordCount","x","lit","setLit","el","m","ro","raf","update","r","vh","start","startAt","end","endAt","total","p","onScroll","Tag","tag","idx","phoneBelow","phoneSize","tabletBelow","tabletSize","fontSize","style","word","bare","isKey","on","highlightColor","color","dim","i","init_P25ScrollStatement"],"sources":["https:/framerusercontent.com/modules/vaQEsxa3bKSei7RdAci4/IzLVN957xSJrEnp86mI2/P25ScrollStatement.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// P25 scroll statement: a big Inter Tight sentence whose words light up one by one\n// (from a dim grey to full white) as the visitor scrolls through it, so it reads like\n// it is being told. Chosen key words light up in lime. The full sentence is always\n// real text in the HTML (a heading), so search engines read it. Respects reduced motion.\n// Sizes: Desktop / Tablet / Phone, picked from the component's own width\n// (Phone below 600px, Tablet below 900px), so the canvas Tablet and Phone frames show them too.\n/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 1200\n */export default function P25ScrollStatement(props){const{text=\"Parallel25 is a content studio that identifies, develops, and sells IP to be produced and distributed in media worldwide.\",highlight=\"identifies, develops, sells\",tag=\"h2\",fontSize=64,tabletSize=48,phoneSize=34,tabletBelow=900,phoneBelow=600,color=\"#ffffff\",highlightColor=\"#d5efa3\",dim=.16,startAt=85,endAt=40,style}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=React.useRef(null);const[w,setW]=React.useState(1200);const words=React.useMemo(()=>String(text).split(/(\\s+)/),[text]);const keys=React.useMemo(()=>String(highlight).split(\",\").map(s=>s.trim().toLowerCase()).filter(Boolean),[highlight]);const wordCount=words.filter(x=>x.trim()).length;const[lit,setLit]=React.useState(isCanvas?wordCount:0);React.useLayoutEffect(()=>{const el=ref.current;if(!el)return;const m=()=>setW(el.getBoundingClientRect().width||1200);m();if(typeof ResizeObserver===\"undefined\")return;const ro=new ResizeObserver(m);ro.observe(el);return()=>ro.disconnect();},[]);React.useEffect(()=>{if(isCanvas||typeof window===\"undefined\")return;if(window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches){setLit(wordCount);return;}let raf=0;const update=()=>{raf=0;const el=ref.current;if(!el)return;const r=el.getBoundingClientRect();const vh=window.innerHeight;const start=vh*startAt/100// text top reaches here: first word lights\n;const end=vh*endAt/100// text bottom reaches here: last word lit\n;const total=r.height+(start-end);const p=Math.min(1,Math.max(0,(start-r.top)/Math.max(1,total)));setLit(Math.round(p*wordCount));};const onScroll=()=>{if(!raf)raf=requestAnimationFrame(update);};update();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);if(raf)cancelAnimationFrame(raf);};},[isCanvas,wordCount,startAt,endAt]);const Tag=tag;let idx=-1;const size=w<phoneBelow?phoneSize:w<tabletBelow?tabletSize:fontSize;return /*#__PURE__*/_jsx(Tag,{ref:ref,style:{margin:0,width:\"100%\",fontFamily:'\"Inter Tight\", \"Inter Tight Placeholder\", sans-serif',fontWeight:400,fontSize:`${size}px`,lineHeight:1.02,letterSpacing:\"-0.03em\",color,textWrap:\"balance\",...style},children:words.map((word,i)=>{if(!word.trim())return word;idx++;const bare=word.toLowerCase().replace(/[^a-z0-9À-ɏ-]/gi,\"\");const isKey=keys.includes(bare);const on=idx<lit;return /*#__PURE__*/_jsx(\"span\",{style:{color:isKey&&on?highlightColor:color,opacity:on?1:dim,transition:\"opacity .35s ease, color .35s ease\"},children:word},i);})});}addPropertyControls(P25ScrollStatement,{text:{type:ControlType.String,title:\"Text\",displayTextArea:true,defaultValue:\"Parallel25 is a content studio that identifies, develops, and sells IP to be produced and distributed in media worldwide.\"},highlight:{type:ControlType.String,title:\"Lime words\",defaultValue:\"identifies, develops, sells\",description:\"Comma-separated words to light up in lime.\"},tag:{type:ControlType.Enum,title:\"Tag\",options:[\"h1\",\"h2\",\"h3\",\"p\"],defaultValue:\"h2\"},fontSize:{type:ControlType.Number,title:\"Desktop size\",defaultValue:64,min:16,max:160,unit:\"px\"},tabletSize:{type:ControlType.Number,title:\"Tablet size\",defaultValue:48,min:16,max:160,unit:\"px\"},phoneSize:{type:ControlType.Number,title:\"Phone size\",defaultValue:34,min:16,max:160,unit:\"px\"},tabletBelow:{type:ControlType.Number,title:\"Tablet below\",defaultValue:900,min:400,max:1600,step:10,unit:\"px\"},phoneBelow:{type:ControlType.Number,title:\"Phone below\",defaultValue:600,min:280,max:1200,step:10,unit:\"px\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"},highlightColor:{type:ControlType.Color,title:\"Lime\",defaultValue:\"#d5efa3\"},dim:{type:ControlType.Number,title:\"Unlit\",defaultValue:.16,min:0,max:1,step:.02},startAt:{type:ControlType.Number,title:\"Start at\",defaultValue:85,min:30,max:100,unit:\"%\"},endAt:{type:ControlType.Number,title:\"Done at\",defaultValue:40,min:0,max:90,unit:\"%\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"P25ScrollStatement\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"1200\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./P25ScrollStatement.map"],"mappings":"A,4NAUG,SAAwBkB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,4HAA4H,YAAU,8BAA8B,MAAI,KAAK,WAAS,GAAG,aAAW,GAAG,YAAU,GA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