{"version":3,"file":"GrainOverlay.CS8Lod1R.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/DienPK5v3hGrH1MnyYNI/NiMYxwoGnz9uESflSM5g/GrainOverlay.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useEffect}from\"react\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function GrainOverlay(props){const{opacity=.15,speed=.3,grainSize=2,tintColor=\"#24261a\",tintOpacity=.35}=props;const containerRef=useRef(null);useEffect(()=>{const el=containerRef.current;if(!el)return;const parent=el.closest(\"[data-framer-name]\")||el.parentElement?.parentElement;if(parent&&parent instanceof HTMLElement){parent.style.position=\"relative\";}},[]);return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",pointerEvents:\"none\",overflow:\"hidden\",zIndex:2},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",backgroundColor:tintColor,opacity:tintOpacity,mixBlendMode:\"multiply\",zIndex:1}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:\"-200%\",width:\"400%\",height:\"400%\",opacity,mixBlendMode:\"overlay\",zIndex:2,backgroundImage:`url(\"data:image/svg+xml,%3Csvg viewBox='0 0 ${grainSize*100} ${grainSize*100}' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E\")`,backgroundRepeat:\"repeat\",backgroundSize:`${grainSize*100}px ${grainSize*100}px`,animation:`grain ${speed}s steps(6) infinite`}}),/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes grain {\n                    0%, 100% { transform: translate(0, 0); }\n                    10% { transform: translate(-5%, -10%); }\n                    20% { transform: translate(-15%, 5%); }\n                    30% { transform: translate(7%, -25%); }\n                    40% { transform: translate(-5%, 25%); }\n                    50% { transform: translate(-15%, 10%); }\n                    60% { transform: translate(15%, 0%); }\n                    70% { transform: translate(0%, 15%); }\n                    80% { transform: translate(3%, 25%); }\n                    90% { transform: translate(-10%, 10%); }\n                }\n            `})]});}addPropertyControls(GrainOverlay,{opacity:{title:\"Grain Opacity\",type:ControlType.Number,defaultValue:.15,min:0,max:.5,step:.01},speed:{title:\"Speed\",type:ControlType.Number,defaultValue:.3,min:.1,max:2,step:.1,unit:\"s\"},grainSize:{title:\"Grain Size\",type:ControlType.Number,defaultValue:2,min:1,max:5,step:.5},tintColor:{title:\"Tint Color\",type:ControlType.Color,defaultValue:\"#24261a\"},tintOpacity:{title:\"Tint Opacity\",type:ControlType.Number,defaultValue:.35,min:0,max:1,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GrainOverlay\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GrainOverlay.map"],"mappings":"mLAGG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,IAAI,QAAM,GAAG,YAAU,EAAE,YAAU,UAAU,cAAY,KAAK,EAAY,EAAaA,EAAO,IAAI,EAA8N,OAA5N,MAAc,CAAC,IAAM,EAAG,EAAa,QAAQ,GAAG,CAAC,EAAG,OAAO,IAAM,EAAO,EAAG,QAAQ,oBAAoB,GAAG,EAAG,eAAe,cAAiB,GAAQ,aAAkB,cAAa,EAAO,MAAM,SAAS,WAAY,EAAE,CAAC,CAAC,EAAsB,EAAM,MAAM,CAAC,IAAI,EAAa,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,MAAM,OAAO,OAAO,OAAO,c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