{"version":3,"file":"ScrollReveal.ft9ukzO2.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/cdPWkVJgte12mkkqKiCZ/3EIfYOHLnP9E5YPNPHm9/ScrollReveal.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect}from\"react\";import{useIsStaticRenderer,addPropertyControls,ControlType}from\"framer\";/**\n * Scroll Reveal — drop ONE of these on the page. It fades + rises each section\n * into view as it scrolls in (skips the sticky nav).\n *\n * It reads the PAGE background:\n *  - On a DARK page it reveals the dark sections (a dark-on-dark fade is clean)\n *    and skips light + transparent-wrapper sections (they'd flash the dark bg).\n *  - On a LIGHT / cream page it reveals NOTHING — a light-on-light section-box\n *    fade is invisible anyway, and fading/rising a cream section breaks its\n *    rounded-top + cream-cap transitions over the dark section above (a seam\n *    flashes). Per-component reveals (titles, cards, counters, marquees) still\n *    animate the content, so the page stays alive without the artifacts.\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 0\n * @framerIntrinsicHeight 0\n * @framerDisableUnlink\n */export default function ScrollReveal(props){const{distance=30,duration=.7}=props;const ref=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic)return;const me=ref.current;if(!me)return;// climb to the sections container (the first ancestor with several children)\nlet root=me.parentElement;let guard=0;while(root&&root.childElementCount<4&&guard<10){root=root.parentElement;guard++;}if(!root)return;// luminance + alpha of a computed background color (null if unparseable)\nconst info=bg=>{const m=bg&&bg.match(/\\d+(?:\\.\\d+)?/g);if(!m||m.length<3)return null;const alpha=m.length>=4?parseFloat(m[3]):1;return{lum:.299*+m[0]+.587*+m[1]+.114*+m[2],alpha};};// read the page background — climb until an opaque background is found\nlet pageLum=20// assume dark if unknown\n;let node=root;let g2=0;while(node&&g2<8){const bi=info(getComputedStyle(node).backgroundColor);if(bi&&bi.alpha>.2){pageLum=bi.lum;break;}node=node.parentElement;g2++;}const pageIsLight=pageLum>140;// On light/cream pages, leave every section box static (see note above).\nif(pageIsLight)return;const kids=Array.from(root.children);const targets=[];kids.forEach((k,i)=>{if(k.contains(me))return;// skip the controller itself\nif(i===0)return;// skip the sticky nav\n// On the dark page, only reveal sections with their OWN opaque dark bg.\n// Skip light sections and transparent-wrapper sections (e.g. the footer,\n// whose dark bg lives inside the component) — fading either flashes the\n// page background through the section.\nconst bi=info(getComputedStyle(k).backgroundColor);const opaque=!!bi&&bi.alpha>.2;const secIsLight=!!bi&&bi.lum>140;if(!opaque||secIsLight!==pageIsLight)return;k.style.opacity=\"0\";k.style.transform=\"translateY(\"+distance+\"px)\";k.style.transition=\"opacity \"+duration+\"s ease, transform \"+duration+\"s cubic-bezier(.22,1,.36,1)\";k.style.willChange=\"opacity, transform\";targets.push(k);});const io=new IntersectionObserver(entries=>{entries.forEach(e=>{if(e.isIntersecting){const t=e.target;t.style.opacity=\"1\";t.style.transform=\"none\";io.unobserve(t);}});},{threshold:.1,rootMargin:\"0px 0px -8% 0px\"});targets.forEach(t=>io.observe(t));return()=>{io.disconnect();targets.forEach(t=>{t.style.opacity=\"\";t.style.transform=\"\";t.style.transition=\"\";t.style.willChange=\"\";});};},[distance,duration,isStatic]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:0,height:0,...props.style}});}addPropertyControls(ScrollReveal,{distance:{type:ControlType.Number,title:\"Rise (px)\",defaultValue:30,min:0,max:120},duration:{type:ControlType.Number,title:\"Duration (s)\",defaultValue:.7,min:.2,max:2,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollReveal\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerDisableUnlink\":\"\",\"framerIntrinsicWidth\":\"0\",\"framerIntrinsicHeight\":\"0\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollReveal.map"],"mappings":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