{"version":3,"file":"InteractiveParticles.D__5rtbl.mjs","names":["useRef","THREE.Vector2","THREE.Raycaster","useMemo","useCallback","THREE.Scene","THREE.PerspectiveCamera","THREE.WebGLRenderer","THREE.Clock","THREE.TextureLoader","THREE.RGBAFormat","THREE.UnsignedByteType","THREE.LinearFilter","THREE.RawShaderMaterial","THREE.InstancedBufferGeometry","THREE.BufferAttribute","THREE.InstancedBufferAttribute","THREE.Mesh","THREE.PlaneGeometry","THREE.MeshBasicMaterial","THREE.Texture"],"sources":["https:/framerusercontent.com/modules/1U2QRuvTSFaCZNvY74ip/muNoVMbLdTCn6xVWKIHZ/InteractiveParticles.js"],"sourcesContent":["function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useEffect,useMemo,useCallback}from\"react\";import*as THREE from\"three\";// ============================================================================\n// TOUCH TEXTURE CLASS\n// ============================================================================\n/**\n * TouchTexture\n *\n * Manages an off-screen canvas that tracks mouse/touch positions and renders\n * them as a grayscale texture. This texture is sampled in the vertex shader\n * to displace particles based on user interaction.\n *\n * The trail effect maintains a history of touch points with age-based fading,\n * creating smooth, organic ripple effects as the user moves their cursor.\n */class TouchTexture{update(){this.clear();// Age points and remove expired ones (iterate backwards to safely splice)\nfor(let i=this.trail.length-1;i>=0;i--){this.trail[i].age++;if(this.trail[i].age>this.maxAge){this.trail.splice(i,1);}}// Draw all touch points with fading\nconst len=this.trail.length;for(let i=0;i<len;i++){this.drawTouch(this.trail[i]);}// Mark texture as needing GPU update\nthis.texture.needsUpdate=true;}clear(){this.ctx.fillStyle=\"black\";this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);}addTouch(point){let force=0;const last=this.trail[this.trail.length-1];if(last){// Calculate force based on movement speed (distance from last point)\nconst dx=last.x-point.x;const dy=last.y-point.y;const dd=dx*dx+dy*dy;force=Math.min(dd*1e4,1);}this.trail.push({x:point.x,y:point.y,age:0,force});}drawTouch(point){const pos={x:point.x*this.size,y:(1-point.y)*this.size};// Calculate fade intensity based on age (fade in first 30%, fade out remaining 70%)\nlet intensity=1;if(point.age<this.maxAge*.3){// Fade in\nintensity=this.easeOutSine(point.age/(this.maxAge*.3),0,1,1);}else{// Fade out\nintensity=this.easeOutSine(1-(point.age-this.maxAge*.3)/(this.maxAge*.7),0,1,1);}// Multiply by movement force for dynamic sizing\nintensity*=point.force;// Draw radial gradient circle\nconst radius=this.size*this.radius*intensity;const grd=this.ctx.createRadialGradient(pos.x,pos.y,radius*.25,pos.x,pos.y,radius);grd.addColorStop(0,`rgba(255, 255, 255, 0.2)`);grd.addColorStop(1,\"rgba(0, 0, 0, 0.0)\");this.ctx.beginPath();this.ctx.fillStyle=grd;this.ctx.arc(pos.x,pos.y,radius,0,Math.PI*2);this.ctx.fill();}easeOutSine(t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;}constructor(radius=.15){_define_property(this,\"size\",void 0);_define_property(this,\"maxAge\",void 0);_define_property(this,\"radius\",void 0);_define_property(this,\"trail\",void 0);_define_property(this,\"canvas\",void 0);_define_property(this,\"ctx\",void 0);_define_property(this,\"texture\",void 0);this.size=64// Resolution of touch texture\n;this.maxAge=120// Frames before touch point fades out\n;this.radius=radius// Size of touch influence area (configurable)\n;this.trail=[];// Create off-screen canvas for touch tracking\nthis.canvas=document.createElement(\"canvas\");this.canvas.width=this.canvas.height=this.size;this.ctx=this.canvas.getContext(\"2d\");this.ctx.fillStyle=\"black\";this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height);this.texture=new THREE.Texture(this.canvas);this.texture.format=THREE.RGBAFormat;this.texture.type=THREE.UnsignedByteType;this.texture.minFilter=THREE.LinearFilter;this.texture.magFilter=THREE.LinearFilter;this.texture.generateMipmaps=false;}}// ============================================================================\n// GLSL SHADERS\n// ============================================================================\n/**\n * Vertex Shader\n *\n * Runs once per particle instance. Handles:\n * - Particle positioning from image pixel data\n * - Random and noise-based displacement\n * - Touch interaction displacement\n * - Dynamic particle sizing based on brightness\n *\n * Uses simplex noise for organic, flowing movement.\n */const vertexShader=`\nprecision highp float;\n\nattribute float pindex;\nattribute vec3 position;\nattribute vec3 offset;\nattribute vec2 uv;\nattribute float angle;\n\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\n\nuniform float uTime;\nuniform float uRandom;\nuniform float uDepth;\nuniform float uSize;\nuniform vec2 uTextureSize;\nuniform sampler2D uTexture;\nuniform sampler2D uTouch;\nuniform float uDisableNoise;\nuniform float uGreyscaleFormula;\nuniform float uSizeByBrightness;\nuniform float uTouchStrength;\n\nvarying vec2 vPUv;\nvarying vec2 vUv;\nvarying float vGrey;\n\n// Simplex 2D noise\nvec3 permute(vec3 x) { return mod(((x*34.0)+1.0)*x, 289.0); }\n\nfloat snoise(vec2 v) {\n    const vec4 C = vec4(0.211324865405187, 0.366025403784439,\n           -0.577350269189626, 0.024390243902439);\n    vec2 i  = floor(v + dot(v, C.yy) );\n    vec2 x0 = v -   i + dot(i, C.xx);\n    vec2 i1;\n    i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n    vec4 x12 = x0.xyxy + C.xxzz;\n    x12.xy -= i1;\n    i = mod(i, 289.0);\n    vec3 p = permute( permute( i.y + vec3(0.0, i1.y, 1.0 ))\n  + i.x + vec3(0.0, i1.x, 1.0 ));\n    vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy),\n    dot(x12.zw,x12.zw)), 0.0);\n    m = m*m ;\n    m = m*m ;\n    vec3 x = 2.0 * fract(p * C.www) - 1.0;\n    vec3 h = abs(x) - 0.5;\n    vec3 ox = floor(x + 0.5);\n    vec3 a0 = x - ox;\n    m *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\n    vec3 g;\n    g.x  = a0.x  * x0.x  + h.x  * x0.y;\n    g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n    return 130.0 * dot(m, g);\n}\n\nfloat random(float n) {\n    return fract(sin(n) * 43758.5453123);\n}\n\n// Calculate greyscale based on formula\nfloat calculateGrey(vec4 color, float formula) {\n    if (formula < 0.5) {\n        // Luminosity (default): 0.21 R + 0.72 G + 0.07 B\n        return color.r * 0.21 + color.g * 0.72 + color.b * 0.07;\n    } else if (formula < 1.5) {\n        // Average: (R + G + B) / 3\n        return (color.r + color.g + color.b) / 3.0;\n    } else if (formula < 2.5) {\n        // Lightness: (max(R,G,B) + min(R,G,B)) / 2\n        float maxVal = max(max(color.r, color.g), color.b);\n        float minVal = min(min(color.r, color.g), color.b);\n        return (maxVal + minVal) / 2.0;\n    } else {\n        // Desaturation: max(R,G,B)\n        return max(max(color.r, color.g), color.b);\n    }\n}\n\nvoid main() {\n    vUv = uv;\n\n    // particle uv\n    vec2 puv = offset.xy / uTextureSize;\n    vPUv = puv;\n\n    // pixel color\n    vec4 colA = texture2D(uTexture, puv);\n    float grey = calculateGrey(colA, uGreyscaleFormula);\n    vGrey = grey;\n\n    // displacement\n    vec3 displaced = offset;\n    // randomise\n    displaced.xy += vec2(random(pindex) - 0.5, random(offset.x + pindex) - 0.5) * uRandom;\n\n    // Apply noise only if not disabled\n    float noiseValue = uDisableNoise > 0.5 ? 0.0 : snoise(vec2(pindex * 0.1, uTime * 0.1));\n    float rndz = (random(pindex) + noiseValue);\n    displaced.z += rndz * (random(pindex) * 2.0 * uDepth);\n    // center\n    displaced.xy -= uTextureSize * 0.5;\n\n    // touch\n    float t = texture2D(uTouch, puv).r;\n    displaced.z += t * uTouchStrength * rndz;\n    displaced.x += cos(angle) * t * uTouchStrength * rndz;\n    displaced.y += sin(angle) * t * uTouchStrength * rndz;\n\n    // particle size\n    float psize = uDisableNoise > 0.5 ? 2.0 : (snoise(vec2(uTime, pindex) * 0.5) + 2.0);\n    psize *= max(grey, uSizeByBrightness);\n    psize *= uSize;\n\n    // final position\n    vec4 mvPosition = modelViewMatrix * vec4(displaced, 1.0);\n    mvPosition.xyz += position * psize;\n    vec4 finalPosition = projectionMatrix * mvPosition;\n\n    gl_Position = finalPosition;\n}\n`;/**\n * Fragment Shader\n *\n * Runs for each pixel of each particle quad. Handles:\n * - Color sampling from original image\n * - Greyscale conversion using luminosity method\n * - Color mode selection (greyscale/colored/custom tint)\n * - Circular particle shape with soft edges via smoothstep\n */const fragmentShader=`\nprecision highp float;\n\nuniform sampler2D uTexture;\nuniform float uColorMode;\nuniform float uParticleShape;\n\nvarying vec2 vPUv;\nvarying vec2 vUv;\nvarying float vGrey;\n\nvoid main() {\n    vec4 color = vec4(0.0);\n    vec2 uv = vUv;\n    vec2 puv = vPUv;\n\n    // pixel color\n    vec4 colA = texture2D(uTexture, puv);\n\n    // Use greyscale calculated in vertex shader\n    float grey = vGrey;\n\n    // Determine final color based on mode\n    vec4 colB;\n    if (uColorMode < 0.5) {\n        // Grayscale mode\n        colB = vec4(grey, grey, grey, 1.0);\n    } else {\n        // Colored mode (preserve original colors)\n        colB = vec4(colA.rgb, 1.0);\n    }\n\n    // Calculate alpha based on particle shape\n    float alpha = 1.0;\n    vec2 center = uv - vec2(0.5);\n    float dist = length(center);\n\n    if (uParticleShape < 0.5) {\n        // Circle (default) - smooth edges\n        float border = 0.3;\n        float radius = 0.5;\n        alpha = smoothstep(radius, radius - border, dist);\n    } else if (uParticleShape < 1.5) {\n        // Square - hard edges\n        float maxDist = max(abs(center.x), abs(center.y));\n        alpha = step(maxDist, 0.5);\n    } else if (uParticleShape < 2.5) {\n        // Soft Square - rounded corners\n        float maxDist = max(abs(center.x), abs(center.y));\n        alpha = smoothstep(0.5, 0.3, maxDist);\n    } else if (uParticleShape < 3.5) {\n        // Star - 5-pointed\n        float angle = atan(center.y, center.x);\n        float r = length(center);\n        float f = abs(cos(angle * 2.5)) * 0.5 + 0.3;\n        alpha = smoothstep(f, f - 0.3, r);\n    } else {\n        // Hexagon\n        float angle = atan(center.y, center.x);\n        float r = length(center);\n        float f = abs(cos(angle * 3.0)) * 0.5 + 0.3;\n        alpha = smoothstep(f, f - 0.3, r);\n    }\n\n    // final color\n    color = colB;\n    color.a = alpha;\n\n    gl_FragColor = color;\n}\n`;// ============================================================================\n// MAIN COMPONENT\n// ============================================================================\n// Easing function for animations\nconst easeInOutQuad=t=>{return t<.5?2*t*t:-1+(4-2*t)*t;};const calculateImageFit=(imgWidth,imgHeight,containerWidth,containerHeight,fitMode,alignX=.5,alignY=.5)=>{const imgAspect=imgWidth/imgHeight;const containerAspect=containerWidth/containerHeight;let scale=1;let offsetX=0;let offsetY=0;switch(fitMode){case\"fill\":// Stretch to fill - use different scales for width and height\n// For particle system, we'll use average to avoid extreme distortion\nscale=(containerWidth/imgWidth+containerHeight/imgHeight)/2;break;case\"cover\":// Scale to cover - larger scale to fill container\nif(imgAspect>containerAspect){scale=containerHeight/imgHeight;}else{scale=containerWidth/imgWidth;}break;case\"contain\":// Scale to fit - smaller scale to fit within container\nif(imgAspect>containerAspect){scale=containerWidth/imgWidth;}else{scale=containerHeight/imgHeight;}break;case\"scale-down\":// Same as contain, but never scale up\nif(imgAspect>containerAspect){scale=Math.min(1,containerWidth/imgWidth);}else{scale=Math.min(1,containerHeight/imgHeight);}break;}// Calculate Alignment\n// X Alignment (0.0 = Left, 1.0 = Right, 0.5 = Center)\nconst scaledWidth=imgWidth*scale;offsetX=(alignX-.5)*(containerWidth-scaledWidth);// Y Alignment (0.0 = Top, 1.0 = Bottom, 0.5 = Center)\n// Note: In standard CSS, 0% is Top, 100% is Bottom.\n// In our 3D calculation previously:\n// If alignY was \"top\", we used yFactor=1.\n// But responsive image usually sends \"0%\" for top.\n// Let's assume standard CSS: 0.0 = Top, 1.0 = Bottom.\n// If alignY is 0 (Top):\n// We want image at Top.\n// View Top is +H/2. Image Top is +h/2 + offsetY.\n// H/2 = h/2 + offsetY => offsetY = (H-h)/2.\n// Formula: (factor - 0.5) * (H-h)\n// If factor is 0: -0.5 * (H-h). This puts it at bottom?\n// Let's re-check the signs.\n// If offsetY is positive, it moves UP.\n// If we want alignment at Top (Ymax), and we have a container larger than image (H > h):\n// We need positive offset.\n// (H-h)/2 is positive.\n// So if factor is 0 (Top), we want +0.5 * (H-h).\n// If factor is 1 (Bottom), we want -0.5 * (H-h).\n// So factor should be INVERTED for Y if 0=Top.\n// New factor = 1 - alignY.\n// (1 - 0 - 0.5) = 0.5. Correct.\n// (1 - 1 - 0.5) = -0.5. Correct.\nconst scaledHeight=imgHeight*scale;const yFactor=1-alignY;offsetY=(yFactor-.5)*(containerHeight-scaledHeight);return{scale,offsetX,offsetY};};/*\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 600\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerDisableUnlink\n */export default function InteractiveParticles(props){const{style,imageSettings={},particleSettings={},motionSettings={},interactionSettings={},performanceSettings={},backgroundColor=\"transparent\"}=props;// Extract from grouped settings with defaults\nconst{image={src:\"https://picsum.photos/800/600\",positionX:\"50%\",positionY:\"50%\"}}=props;const{imageFit=\"contain\",colorMode=\"grayscale\",greyscaleFormula=\"luminosity\"}=imageSettings;const{particleShape=\"circle\",particleSize=1.5,brightnessThreshold=34,sizeByBrightness=.2}=particleSettings;const{showAnimation=true,depthEffect=4,randomness=2,disableNoise=false,staticMode=false,freezeTime=0}=motionSettings;const{touchRadius=.15,touchStrength=20}=interactionSettings;const{maxTextureSize=300,samplingRate=1}=performanceSettings;// RenderTarget detection (keeping for potential future use)\n// const isCanvas = RenderTarget.current() === RenderTarget.canvas\n// Use same settings for both canvas and preview for consistent WYSIWYG experience\nconst actualSamplingRate=samplingRate;const actualMaxTextureSize=maxTextureSize;const containerRef=useRef(null);const canvasRef=useRef(null);const sceneRef=useRef(null);const cameraRef=useRef(null);const rendererRef=useRef(null);const particlesRef=useRef(null);const touchTextureRef=useRef(null);const animationFrameRef=useRef(null);const clockRef=useRef(null);const mouseRef=useRef(new THREE.Vector2);const raycasterRef=useRef(new THREE.Raycaster);const hitAreaRef=useRef(null);const uniformsRef=useRef(null);const lastTouchTimeRef=useRef(0);// Parse alignment percentages\nconst imageAlignXValue=useMemo(()=>{if(!image?.positionX)return .5;return parseFloat(image.positionX)/100;},[image]);const imageAlignYValue=useMemo(()=>{if(!image?.positionY)return .5;return parseFloat(image.positionY)/100;},[image]);const imgSrc=image?.src||\"\";// Memoize greyscale formula value to avoid recalculation\nconst greyscaleFormulaValue=useMemo(()=>{switch(greyscaleFormula){case\"luminosity\":return 0;case\"average\":return 1;case\"lightness\":return 2;case\"desaturation\":return 3;default:return 0;}},[greyscaleFormula]);// Memoize color mode value\nconst colorModeValue=useMemo(()=>{return colorMode===\"grayscale\"?0:1;},[colorMode]);// Memoize particle shape value\nconst particleShapeValue=useMemo(()=>{switch(particleShape){case\"circle\":return 0;case\"square\":return 1;case\"soft-square\":return 2;case\"star\":return 3;case\"hexagon\":return 4;default:return 0;}},[particleShape]);// Throttled touch handler with RAF\nconst handleMove=useCallback(event=>{const now=performance.now();// Throttle to ~60fps max\nif(now-lastTouchTimeRef.current<16)return;lastTouchTimeRef.current=now;const canvas=canvasRef.current;const camera=cameraRef.current;if(!canvas||!camera)return;const rect=canvas.getBoundingClientRect();const clientX=\"touches\"in event?event.touches[0]?.clientX:event.clientX;const clientY=\"touches\"in event?event.touches[0]?.clientY:event.clientY;if(clientX===undefined||clientY===undefined)return;mouseRef.current.x=(clientX-rect.left)/rect.width*2-1;mouseRef.current.y=-((clientY-rect.top)/rect.height)*2+1;raycasterRef.current.setFromCamera(mouseRef.current,camera);if(hitAreaRef.current&&touchTextureRef.current){const intersects=raycasterRef.current.intersectObject(hitAreaRef.current);if(intersects.length>0){const uv=intersects[0].uv;if(uv){touchTextureRef.current.addTouch(uv);}}}},[]);useEffect(()=>{let isMounted=true;if(!containerRef.current||!canvasRef.current)return;const canvas=canvasRef.current;const container=containerRef.current;const width=container.clientWidth;const height=container.clientHeight;// Initialize Three.js scene\nconst scene=new THREE.Scene;sceneRef.current=scene;const camera=new THREE.PerspectiveCamera(50,width/height,1,1e4);camera.position.z=300;cameraRef.current=camera;const renderer=new THREE.WebGLRenderer({canvas,antialias:true,alpha:true,preserveDrawingBuffer:true});renderer.setSize(width,height,false);renderer.setPixelRatio(Math.min(window.devicePixelRatio,2));rendererRef.current=renderer;const clock=new THREE.Clock(true);clockRef.current=clock;// Load image and create particles\nconst loader=new THREE.TextureLoader;loader.setCrossOrigin(\"anonymous\")// Enable CORS for external images\n;if(!imgSrc)return;loader.load(imgSrc,texture=>{if(!isMounted)return;texture.format=THREE.RGBAFormat;texture.type=THREE.UnsignedByteType;texture.minFilter=THREE.LinearFilter;texture.magFilter=THREE.LinearFilter;texture.generateMipmaps=false;const originalWidth=texture.image.width;const originalHeight=texture.image.height;// Calculate scaled dimensions to limit texture size\nlet imgWidth=originalWidth;let imgHeight=originalHeight;const maxDimension=Math.max(imgWidth,imgHeight);if(maxDimension>actualMaxTextureSize){const scale=actualMaxTextureSize/maxDimension;imgWidth=Math.floor(originalWidth*scale);imgHeight=Math.floor(originalHeight*scale);}// Create touch texture with configurable radius\nconst touchTexture=new TouchTexture(touchRadius);touchTextureRef.current=touchTexture;// Extract pixel data from image with downsampling\nconst img=texture.image;const tempCanvas=document.createElement(\"canvas\");const ctx=tempCanvas.getContext(\"2d\",{willReadFrequently:true});tempCanvas.width=imgWidth;tempCanvas.height=imgHeight;ctx.scale(1,-1)// Flip Y to match WebGL coordinate system\n;ctx.drawImage(img,0,0,imgWidth,imgHeight*-1);let imgData;let originalColors;try{imgData=ctx.getImageData(0,0,imgWidth,imgHeight);originalColors=Float32Array.from(imgData.data);}catch(error){console.warn(\"Unable to read image data (CORS issue). Using fallback method.\",error);// Fallback: create uniform particle distribution\nconst totalPixels=imgWidth*imgHeight;originalColors=new Float32Array(totalPixels*4);// Fill with white pixels so all particles are visible\nfor(let i=0;i<totalPixels;i++){originalColors[i*4+0]=255// R\n;originalColors[i*4+1]=255// G\n;originalColors[i*4+2]=255// B\n;originalColors[i*4+3]=255// A\n;}}// Optimization: Count visible pixels above brightness threshold with sampling\nlet numVisible=0;const threshold=brightnessThreshold;const step=Math.max(1,Math.floor(actualSamplingRate));// Count pixels above threshold with sampling (optimized loop)\nfor(let y=0;y<imgHeight;y+=step){for(let x=0;x<imgWidth;x+=step){const i=y*imgWidth+x;if(originalColors[i*4+0]>threshold)numVisible++;}}// Create uniforms using memoized values\nconst uniforms={uTime:{value:staticMode?freezeTime:0},uRandom:{value:showAnimation?5:randomness},uDepth:{value:showAnimation?40:depthEffect},uSize:{value:showAnimation?.5:particleSize},uTextureSize:{value:new THREE.Vector2(imgWidth,imgHeight)},uTexture:{value:texture},uTouch:{value:touchTexture.texture},uColorMode:{value:colorModeValue},uParticleShape:{value:particleShapeValue},uDisableNoise:{value:disableNoise||staticMode?1:0},uGreyscaleFormula:{value:greyscaleFormulaValue},uSizeByBrightness:{value:sizeByBrightness},uTouchStrength:{value:touchStrength}};uniformsRef.current=uniforms;const material=new THREE.RawShaderMaterial({uniforms,vertexShader,fragmentShader,depthTest:false,transparent:true});// Instanced Geometry: One quad geometry rendered thousands of times\nconst geometry=new THREE.InstancedBufferGeometry;// Base quad positions (4 vertices forming 2 triangles)\nconst positions=new THREE.BufferAttribute(new Float32Array(4*3),3);positions.setXYZ(0,-.5,.5,0);positions.setXYZ(1,.5,.5,0);positions.setXYZ(2,-.5,-.5,0);positions.setXYZ(3,.5,-.5,0);geometry.setAttribute(\"position\",positions);// UV coordinates for texture sampling\nconst uvs=new THREE.BufferAttribute(new Float32Array(4*2),2);uvs.setXY(0,0,0);uvs.setXY(1,1,0);uvs.setXY(2,0,1);uvs.setXY(3,1,1);geometry.setAttribute(\"uv\",uvs);// Index buffer: defines two triangles from the 4 vertices\ngeometry.setIndex(new THREE.BufferAttribute(new Uint16Array([0,2,1,2,3,1]),1));// Pre-allocate typed arrays for instance attributes (optimized)\nconst indices=new Uint16Array(numVisible);const offsets=new Float32Array(numVisible*3);const angles=new Float32Array(numVisible);// Populate instance data only for visible pixels with sampling (optimized)\nlet j=0;const twoPI=Math.PI*2;for(let y=0;y<imgHeight;y+=step){for(let x=0;x<imgWidth;x+=step){const i=y*imgWidth+x;if(originalColors[i*4+0]<=threshold)continue;const j3=j*3;// Use actual x,y coordinates accounting for sampling\noffsets[j3]=x;offsets[j3+1]=y;offsets[j3+2]=0;indices[j]=i;// Random angle for touch displacement direction\nangles[j]=Math.random()*twoPI;j++;}}// pindex: particle index for shader randomness\ngeometry.setAttribute(\"pindex\",new THREE.InstancedBufferAttribute(indices,1,false));// offset: x,y position in image coordinates\ngeometry.setAttribute(\"offset\",new THREE.InstancedBufferAttribute(offsets,3,false));// angle: random angle for radial displacement\ngeometry.setAttribute(\"angle\",new THREE.InstancedBufferAttribute(angles,1,false));const particles=new THREE.Mesh(geometry,material);scene.add(particles);particlesRef.current=particles;// Create hit area\nconst hitGeometry=new THREE.PlaneGeometry(imgWidth,imgHeight,1,1);const hitMaterial=new THREE.MeshBasicMaterial({color:16777215,wireframe:false,transparent:true,opacity:0});const hitArea=new THREE.Mesh(hitGeometry,hitMaterial);scene.add(hitArea);hitAreaRef.current=hitArea;// Resize particles with fit mode\nconst fovHeight=2*Math.tan(camera.fov*Math.PI/180*.5)*camera.position.z;const fovWidth=fovHeight*camera.aspect;// Calculate fit transform\nconst fitTransform=calculateImageFit(imgWidth,imgHeight,fovWidth,fovHeight,imageFit,imageAlignXValue,imageAlignYValue);const finalScale=fitTransform.scale;particles.scale.set(finalScale,finalScale,1);particles.position.set(fitTransform.offsetX,fitTransform.offsetY,0);hitArea.scale.set(finalScale,finalScale,1);hitArea.position.set(fitTransform.offsetX,fitTransform.offsetY,0);// Animate entrance if enabled\nif(showAnimation){animateEntrance(uniforms,particleSize,depthEffect,randomness);}});// Entrance animation function\nconst animateEntrance=(uniforms,targetSize,targetDepth,targetRandom)=>{const duration=1500// 1.5 seconds\n;const startTime=Date.now();const animateIn=()=>{const elapsed=Date.now()-startTime;const progress=Math.min(elapsed/duration,1);const eased=easeInOutQuad(progress);// Animate size\nuniforms.uSize.value=.5+(targetSize-.5)*eased;// Animate depth\nuniforms.uDepth.value=40+(targetDepth-40)*eased;// Animate randomness\nuniforms.uRandom.value=5+(targetRandom-5)*eased;if(progress<1){requestAnimationFrame(animateIn);}};animateIn();};// Use the memoized and throttled handleMove callback\ncanvas.addEventListener(\"mousemove\",handleMove);canvas.addEventListener(\"touchmove\",handleMove,{passive:true});// Animation loop\nconst animate=()=>{if(!clockRef.current||!rendererRef.current||!sceneRef.current||!cameraRef.current){return;}const delta=clockRef.current.getDelta();if(touchTextureRef.current){touchTextureRef.current.update();}if(uniformsRef.current&&!staticMode){uniformsRef.current.uTime.value+=delta;}rendererRef.current.render(sceneRef.current,cameraRef.current);animationFrameRef.current=requestAnimationFrame(animate);};animate();// Resize handler with debouncing\nlet resizeTimeout=null;const handleResize=()=>{if(!container||!camera||!renderer)return;// Debounce resize to avoid excessive recalculations\nif(resizeTimeout){clearTimeout(resizeTimeout);}resizeTimeout=setTimeout(()=>{const newWidth=container.clientWidth;const newHeight=container.clientHeight;// Only resize if dimensions actually changed\nif(newWidth===0||newHeight===0)return;camera.aspect=newWidth/newHeight;camera.updateProjectionMatrix();renderer.setSize(newWidth,newHeight,false);renderer.setPixelRatio(Math.min(window.devicePixelRatio,2));if(particlesRef.current&&hitAreaRef.current&&uniformsRef.current){const fovHeight=2*Math.tan(camera.fov*Math.PI/180*.5)*camera.position.z;const fovWidth=fovHeight*camera.aspect;const imgWidth=uniformsRef.current.uTextureSize.value.x||1;const imgHeight=uniformsRef.current.uTextureSize.value.y||1;// Calculate fit transform\nconst fitTransform=calculateImageFit(imgWidth,imgHeight,fovWidth,fovHeight,imageFit,imageAlignXValue,imageAlignYValue);const finalScale=fitTransform.scale;particlesRef.current.scale.set(finalScale,finalScale,1);particlesRef.current.position.set(fitTransform.offsetX,fitTransform.offsetY,0);hitAreaRef.current.scale.set(finalScale,finalScale,1);hitAreaRef.current.position.set(fitTransform.offsetX,fitTransform.offsetY,0);}},100)// 100ms debounce\n;};window.addEventListener(\"resize\",handleResize);// Use ResizeObserver for more accurate container resize detection\nconst resizeObserver=new ResizeObserver(()=>{handleResize();});resizeObserver.observe(container);// Cleanup\nreturn()=>{isMounted=false;if(animationFrameRef.current){cancelAnimationFrame(animationFrameRef.current);}if(resizeTimeout){clearTimeout(resizeTimeout);}resizeObserver.disconnect();canvas.removeEventListener(\"mousemove\",handleMove);canvas.removeEventListener(\"touchmove\",handleMove);window.removeEventListener(\"resize\",handleResize);if(particlesRef.current){particlesRef.current.geometry.dispose();particlesRef.current.material.dispose();}if(hitAreaRef.current){hitAreaRef.current.geometry.dispose();hitAreaRef.current.material.dispose();}if(rendererRef.current){rendererRef.current.dispose();rendererRef.current=null;}if(sceneRef.current){sceneRef.current=null;}if(cameraRef.current){cameraRef.current=null;}};},[image,imgSrc,imageFit,imageAlignXValue,imageAlignYValue,colorModeValue,particleShapeValue,greyscaleFormulaValue,particleSize,depthEffect,randomness,touchRadius,touchStrength,showAnimation,staticMode,freezeTime,brightnessThreshold,disableNoise,actualMaxTextureSize,actualSamplingRate,sizeByBrightness,handleMove]);// Update uniforms when props change\nuseEffect(()=>{if(uniformsRef.current){uniformsRef.current.uSize.value=particleSize;uniformsRef.current.uDepth.value=depthEffect;uniformsRef.current.uRandom.value=randomness;uniformsRef.current.uSizeByBrightness.value=sizeByBrightness;uniformsRef.current.uTouchStrength.value=touchStrength;}},[particleSize,depthEffect,randomness,sizeByBrightness,touchStrength]);// Update color when color mode changes (using memoized values)\nuseEffect(()=>{if(uniformsRef.current){uniformsRef.current.uColorMode.value=colorModeValue;}},[colorMode,colorModeValue]);// Update particle shape when it changes (using memoized values)\nuseEffect(()=>{if(uniformsRef.current){uniformsRef.current.uParticleShape.value=particleShapeValue;}},[particleShape,particleShapeValue]);// Update advanced settings when they change (optimized with memoized values)\nuseEffect(()=>{if(uniformsRef.current){uniformsRef.current.uDisableNoise.value=disableNoise||staticMode?1:0;uniformsRef.current.uGreyscaleFormula.value=greyscaleFormulaValue;if(staticMode){uniformsRef.current.uTime.value=freezeTime;}}},[disableNoise,greyscaleFormulaValue,staticMode,freezeTime]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",backgroundColor,position:\"relative\",overflow:\"hidden\",...style},children:/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,style:{display:\"block\",width:\"100%\",height:\"100%\"}})});}// ============================================================================\n// PROPERTY CONTROLS\n// ============================================================================\naddPropertyControls(InteractiveParticles,{image:{type:ControlType.ResponsiveImage,title:\"Source\"},// Image & Color Group\nimageSettings:{type:ControlType.Object,title:\"Image\",controls:{imageFit:{type:ControlType.Enum,title:\"Fit\",options:[\"fill\",\"cover\",\"contain\",\"scale-down\"],optionTitles:[\"Fill\",\"Cover\",\"Contain\",\"Scale Down\"],defaultValue:\"contain\",description:\"How the image fits within the container\"},colorMode:{type:ControlType.Enum,title:\"Style\",options:[\"grayscale\",\"colored\"],optionTitles:[\"Black & White\",\"Full Color\"],defaultValue:\"grayscale\",description:\"Render particles in grayscale or original colors\"},greyscaleFormula:{type:ControlType.Enum,title:\"Contrast\",options:[\"luminosity\",\"average\",\"lightness\",\"desaturation\"],optionTitles:[\"Natural\",\"Balanced\",\"Soft\",\"Bright\"],defaultValue:\"luminosity\",description:\"Algorithm for grayscale conversion\"}}},// Particle Appearance Group\nparticleSettings:{type:ControlType.Object,title:\"Particles\",controls:{particleShape:{type:ControlType.Enum,title:\"Shape\",options:[\"circle\",\"square\",\"soft-square\",\"star\",\"hexagon\"],optionTitles:[\"Circle\",\"Square\",\"Soft Square\",\"Star\",\"Hexagon\"],defaultValue:\"circle\",description:\"Geometric shape of each particle\"},particleSize:{type:ControlType.Number,title:\"Size\",defaultValue:1.5,min:.5,max:3,step:.1,displayStepper:true,description:\"Scale of individual particles\"},brightnessThreshold:{type:ControlType.Number,title:\"Detail\",defaultValue:34,min:0,max:100,step:5,displayStepper:true,description:\"Lower values show more particles from darker areas\"},sizeByBrightness:{type:ControlType.Number,title:\"Min Brightness Size\",defaultValue:.2,min:0,max:1,step:.1,displayStepper:true,description:\"Size multiplier for dark particles (0=tiny, 1=uniform)\"}}},// Motion & Animation Group\nmotionSettings:{type:ControlType.Object,title:\"Motion\",controls:{showAnimation:{type:ControlType.Boolean,title:\"Entrance Animation\",defaultValue:true,description:\"Animate particles gathering on load\"},depthEffect:{type:ControlType.Number,title:\"3D Depth\",defaultValue:4,min:0,max:10,step:.5,displayStepper:true,description:\"Z-axis displacement for parallax depth effect\"},randomness:{type:ControlType.Number,title:\"Spread\",defaultValue:2,min:0,max:5,step:.5,displayStepper:true,description:\"Random position offset for organic look\"},disableNoise:{type:ControlType.Boolean,title:\"Freeze Movement\",defaultValue:false,description:\"Stop continuous noise-based animation\"},staticMode:{type:ControlType.Boolean,title:\"Static Mode\",defaultValue:false,description:\"Completely freeze all particle animation\"},freezeTime:{type:ControlType.Number,title:\"Freeze Time\",defaultValue:0,min:0,max:100,step:1,displayStepper:true,description:\"Fixed time value when static mode is enabled\"}}},// Interaction Group\ninteractionSettings:{type:ControlType.Object,title:\"Interaction\",controls:{touchRadius:{type:ControlType.Number,title:\"Touch Size\",defaultValue:.15,min:.05,max:.5,step:.05,displayStepper:true,description:\"Size of the mouse/touch influence area\"},touchStrength:{type:ControlType.Number,title:\"Touch Strength\",defaultValue:20,min:0,max:50,step:5,displayStepper:true,description:\"Intensity of particle displacement on hover\"}}},// Performance Group\nperformanceSettings:{type:ControlType.Object,title:\"Performance\",controls:{maxTextureSize:{type:ControlType.Number,title:\"Max Resolution\",defaultValue:300,min:100,max:800,step:50,displayStepper:true,description:\"Maximum image processing size (lower = faster)\"},samplingRate:{type:ControlType.Number,title:\"Sampling\",defaultValue:1,min:1,max:4,step:1,displayStepper:true,description:\"Skip pixels (1=every pixel, 2=every other)\"}}},// Background Color (standalone)\nbackgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"transparent\",description:\"Background color behind the particles\"}});InteractiveParticles.displayName=\"Interactive Particles\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InteractiveParticles\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"600\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"800\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./InteractiveParticles.map"],"mappings":"kYAAA,SAAS,EAAiB,EAAI,EAAI,EAAM,CAAmI,OAA/H,KAAO,EAAK,OAAO,eAAe,EAAI,EAAI,CAAO,QAAM,WAAW,GAAK,aAAa,GAAK,SAAS,GAAK,CAAC,CAAO,EAAI,GAAK,EAAc,EAuR/K,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,QAAM,gBAAc,EAAE,CAAC,mBAAiB,EAAE,CAAC,iBAAe,EAAE,CAAC,sBAAoB,EAAE,CAAC,sBAAoB,EAAE,CAAC,kBAAgB,eAAe,EAClM,CAAC,QAAM,CAAC,IAAI,gCAAgC,UAAU,MAAM,UAAU,MAAM,EAAE,EAAW,CAAC,WAAS,UAAU,YAAU,YAAY,mBAAiB,cAAc,EAAmB,CAAC,gBAAc,SAAS,eAAa,IAAI,uBAAoB,GAAG,mBAAiB,IAAI,EAAsB,CAAC,gBAAc,GAAK,cAAY,EAAE,aAAW,EAAE,eAAa,GAAM,aAAW,GAAM,aAAW,GAAG,EAAoB,CAAC,eAAY,IAAI,gBAAc,IAAI,EAAyB,CAAC,iBAAe,IAAI,eAAa,GAAG,EAGpf,GAAmB,EAAmB,EAAqB,EAAqB,EAAaA,EAAO,KAAK,CAAO,EAAUA,EAAO,KAAK,CAAO,EAASA,EAAO,KAAK,CAAO,EAAUA,EAAO,KAAK,CAAO,EAAYA,EAAO,KAAK,CAAO,EAAaA,EAAO,KAAK,CAAO,EAAgBA,EAAO,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