{"version":3,"file":"NoiseTexture.9r2-R7i2.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/4fTEJEJbHX5rqobVVoH3/I3iAjww1wep0jtla343f/NoiseTexture.js"],"sourcesContent":["// Noise texture component with customizable parameters\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Noise Texture\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function NoiseTexture(props){const{opacity=.5,scale=1,speed=.5,color=\"#000000\",blendMode=\"overlay\",animated=true}=props;const canvasRef=useRef(null);const animationRef=useRef();const lastFrameTimeRef=useRef(0);const isStatic=useIsStaticRenderer();useEffect(()=>{if(typeof window===\"undefined\")return;const canvas=canvasRef.current;if(!canvas)return;const ctx=canvas.getContext(\"2d\");if(!ctx)return;const width=canvas.width;const height=canvas.height;const generateNoise=(time=0)=>{const imageData=ctx.createImageData(width,height);const data=imageData.data;const scaledWidth=Math.floor(width/scale);const scaledHeight=Math.floor(height/scale);for(let y=0;y<scaledHeight;y++){for(let x=0;x<scaledWidth;x++){const value=Math.random()*255;const index=(y*scaledWidth+x)*4;for(let dy=0;dy<scale;dy++){for(let dx=0;dx<scale;dx++){const px=Math.floor(x*scale+dx);const py=Math.floor(y*scale+dy);if(px<width&&py<height){const pixelIndex=(py*width+px)*4;data[pixelIndex]=value;data[pixelIndex+1]=value;data[pixelIndex+2]=value;data[pixelIndex+3]=255;}}}}}ctx.putImageData(imageData,0,0);};const animate=time=>{generateNoise(time);if(animated&&!isStatic){animationRef.current=requestAnimationFrame(animate);}};if(animated&&!isStatic){lastFrameTimeRef.current=0;animate(0);}else{generateNoise();}return()=>{if(animationRef.current){cancelAnimationFrame(animationRef.current);}};},[scale,speed,animated,isStatic]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",...props.style},children:/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,width:800,height:800,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",opacity:opacity,mixBlendMode:blendMode,filter:`hue-rotate(${color})`,imageRendering:\"pixelated\"}})});}addPropertyControls(NoiseTexture,{opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:.5,min:0,max:1,step:.01},scale:{type:ControlType.Number,title:\"Scale\",defaultValue:1,min:1,max:10,step:1},animated:{type:ControlType.Boolean,title:\"Animated\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:.5,min:.1,max:2,step:.1,hidden:({animated})=>!animated},color:{type:ControlType.Color,title:\"Tint\",defaultValue:\"#000000\"},blendMode:{type:ControlType.Enum,title:\"Blend Mode\",options:[\"normal\",\"multiply\",\"screen\",\"overlay\",\"darken\",\"lighten\",\"color-dodge\",\"color-burn\"],optionTitles:[\"Normal\",\"Multiply\",\"Screen\",\"Overlay\",\"Darken\",\"Lighten\",\"Color Dodge\",\"Color Burn\"],defaultValue:\"overlay\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NoiseTexture\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NoiseTexture.map"],"mappings":"kMASG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,UAAQ,GAAG,QAAM,EAAE,QAAM,GAAG,QAAM,UAAU,YAAU,UAAU,WAAS,IAAM,EAAY,EAAUA,EAAO,IAAI,EAAQ,EAAaA,EAAO,EAAQ,EAAiBA,EAAO,CAAC,EAAQ,EAAS,EAAoB,EAAqoC,OAAnoC,MA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