You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
}`;constJe=t=>{consts=u.useMemo(()=>newn.PlaneGeometry(2,2),[]),o=u.useMemo(()=>newn.ShaderMaterial({uniforms:{uTime:{value:0},scale:{value:0},timeStrength:{value:0},noiseOctaves:{value:0},fbmOctaves:{value:0},warpOctaves:{value:0},warpDirection:{value:newn.Vector2},warpStrength:{value:0}},vertexShader:Ke,fragmentShader:Ze}),[]);returnU(t,s,o),o},ee={scale:.004,timeStrength:.3,noiseOctaves:2,fbmOctaves:2,warpOctaves:2,warpDirection:newn.Vector2(2,2),warpStrength:8},Qe=({size:t,dpr:s,samples:o=0})=>{consta=u.useMemo(()=>newn.Scene,[]),e=Je(a),l=b(t),[v,f]=C({scene:a,camera:l,size:t,dpr:s,samples:o}),[r,c]=D(ee);return[u.useCallback((p,d)=>{const{gl:g,clock:h}=p;returnd&&c(d),i(e,"scale",r.scale),i(e,"timeStrength",r.timeStrength),i(e,"noiseOctaves",r.noiseOctaves),i(e,"fbmOctaves",r.fbmOctaves),i(e,"warpOctaves",r.warpOctaves),i(e,"warpDirection",r.warpDirection),i(e,"warpStrength",r.warpStrength),i(e,"uTime",h.getElapsedTime()),f(g)},[f,e,c,r]),c,{scene:a,material:e,camera:l,renderTarget:v,output:v.texture}]},W=process.env.NODE_ENV==="development",en=t=>{vare,l,v;consts=(e=t.dom)==null?void0:e.length,o=(l=t.texture)==null?void0:l.length,a=(v=t.resolution)==null?void0:v.length;return!s||!o||!a?(W&&console.warn("No dom or texture or resolution is set"),!1):s!==o||s!==a?(W&&console.warn("not Match dom , texture and resolution length"),!1):!0};varnn=`varying vec2 vUv;
482
+
}`;constJe=t=>{consts=u.useMemo(()=>newn.PlaneGeometry(2,2),[]),o=u.useMemo(()=>newn.ShaderMaterial({uniforms:{uTime:{value:0},scale:{value:0},timeStrength:{value:0},noiseOctaves:{value:0},fbmOctaves:{value:0},warpOctaves:{value:0},warpDirection:{value:newn.Vector2},warpStrength:{value:0}},vertexShader:Ke,fragmentShader:Ze}),[]);returnU(t,s,o),o},ee={scale:.004,timeStrength:.3,noiseOctaves:2,fbmOctaves:2,warpOctaves:2,warpDirection:newn.Vector2(2,2),warpStrength:8},Qe=({size:t,dpr:s,samples:o=0})=>{consta=u.useMemo(()=>newn.Scene,[]),e=Je(a),l=b(t),[v,f]=C({scene:a,camera:l,size:t,dpr:s,samples:o}),[r,c]=D(ee);return[u.useCallback((p,d)=>{const{gl:g,clock:h}=p;returnd&&c(d),i(e,"scale",r.scale),i(e,"timeStrength",r.timeStrength),i(e,"noiseOctaves",r.noiseOctaves),i(e,"fbmOctaves",r.fbmOctaves),i(e,"warpOctaves",r.warpOctaves),i(e,"warpDirection",r.warpDirection),i(e,"warpStrength",r.warpStrength),i(e,"uTime",h.getElapsedTime()),f(g)},[f,e,c,r]),c,{scene:a,material:e,camera:l,renderTarget:v,output:v.texture}]},W=process.env.NODE_ENV==="development",en=t=>{vare,l,v;consts=(e=t.dom)==null?void0:e.length,o=(l=t.texture)==null?void0:l.length,a=(v=t.resolution)==null?void0:v.length;return!s||!o||!a?(W&&console.warn("No dom or texture or resolution is set"),!0):s!==o||s!==a?(W&&console.warn("not Match dom , texture and resolution length"),!0):!1};varnn=`varying vec2 vUv;
483
483
484
484
void main() {
485
485
vUv = uv;
@@ -527,7 +527,7 @@ void main() {
527
527
alpha *= textureAlpha;
528
528
529
529
gl_FragColor = vec4(textureColor, alpha);
530
-
}`;constrn=({params:t,size:s,scene:o})=>{o.children.length>0&&(o.children.forEach(a=>{ainstanceofn.Mesh&&(a.geometry.dispose(),a.material.dispose())}),o.remove(...o.children)),t.texture.forEach((a,e)=>{constl=newn.Mesh(newn.PlaneGeometry(1,1),newn.ShaderMaterial({vertexShader:nn,fragmentShader:tn,transparent:!0,uniforms:{u_texture:{value:a},u_textureResolution:{value:newn.Vector2(0,0)},u_resolution:{value:newn.Vector2(0,0)},u_borderRadius:{value:t.boderRadius[e]?t.boderRadius[e]:0}}}));o.add(l)})},on=()=>{constt=u.useRef([]),s=u.useRef([]);returnu.useCallback(({isIntersectingRef:a,isIntersectingOnceRef:e,params:l})=>{t.current.length>0&&t.current.forEach((f,r)=>{f.unobserve(s.current[r])}),s.current=[],t.current=[];constv=newArray(l.dom.length).fill(!1);a.current=[...v],e.current=[...v],l.dom.forEach((f,r)=>{constc=p=>{p.forEach(d=>{l.onIntersect[r]&&l.onIntersect[r](d),a.current[r]=d.isIntersecting})},m=newIntersectionObserver(c,{rootMargin:"0px",threshold:0});m.observe(f),t.current.push(m),s.current.push(f)})},[])},un=()=>{constt=u.useRef([]),s=u.useCallback(({params:o,size:a,resolutionRef:e,scene:l,isIntersectingRef:v})=>{l.children.length!==t.current.length&&(t.current=newArray(l.children.length)),l.children.forEach((f,r)=>{constc=o.dom[r];if(!c){W&&console.warn("DOM is null.");return}constm=c.getBoundingClientRect();if(t.current[r]=m,f.scale.set(m.width,m.height,1),f.position.set(m.left+m.width*.5-a.width*.5,-m.top-m.height*.5+a.height*.5,0),v.current[r]&&(o.rotation[r]&&f.rotation.copy(o.rotation[r]),finstanceofn.Mesh)){constp=f.material;i(p,"u_texture",o.texture[r]),i(p,"u_textureResolution",o.resolution[r]),i(p,"u_resolution",e.current.set(m.width,m.height)),i(p,"u_borderRadius",o.boderRadius[r]?o.boderRadius[r]:0)}})},[]);return[t.current,s]},an=()=>{constt=u.useRef([]),s=u.useRef([]),o=u.useCallback((a,e=!1)=>{t.current.forEach((v,f)=>{v&&(s.current[f]=!0)});constl=e?[...s.current]:[...t.current];returna<0?l:l[a]},[]);return{isIntersectingRef:t,isIntersectingOnceRef:s,isIntersecting:o}},sn=t=>({onView:o,onHidden:a})=>{conste=u.useRef(!1);u.useEffect(()=>{letl;constv=()=>{t.current.some(f=>f)?e.current||(o&&o(),e.current=!0):e.current&&(a&&a(),e.current=!1),l=requestAnimationFrame(v)};returnl=requestAnimationFrame(v),()=>{cancelAnimationFrame(l)}},[o,a])},ne={texture:[],dom:[],resolution:[],boderRadius:[],rotation:[],onIntersect:[]},ln=({size:t,dpr:s,samples:o=0},a=[],e)=>{constl=u.useMemo(()=>newn.Scene,[]),v=b(t),[f,r]=C({scene:l,camera:v,size:t,dpr:s,samples:o,isSizeUpdate:!0}),[c,m]=D({...ne,updateKey:e}),[p,d]=un(),g=u.useRef(newn.Vector2(0,0)),[h,y]=u.useState(!0);u.useEffect(()=>{y(!0)},a);constM=u.useRef(null),_=u.useMemo(()=>newn.Texture,[]),T=on(),{isIntersectingOnceRef:P,isIntersectingRef:A,isIntersecting:E}=an(),R=sn(A);return[u.useCallback((z,k)=>{const{gl:j,size:V}=z;if(k&&m(k),!en(c))return_;if(h){if(M.current===c.updateKey)return_;M.current=c.updateKey}returnh&&(rn({params:c,size:V,scene:l}),T({isIntersectingRef:A,isIntersectingOnceRef:P,params:c}),y(!1)),d({params:c,size:V,resolutionRef:g,scene:l,isIntersectingRef:A}),r(j)},[r,m,T,d,h,l,c,P,A,_]),m,{scene:l,camera:v,renderTarget:f,output:f.texture,isIntersecting:E,DOMRects:p,intersections:A.current,useDomView:R}]};varcn=`precision mediump float;
530
+
}`;constrn=({params:t,size:s,scene:o})=>{o.children.length>0&&(o.children.forEach(a=>{ainstanceofn.Mesh&&(a.geometry.dispose(),a.material.dispose())}),o.remove(...o.children)),t.texture.forEach((a,e)=>{constl=newn.Mesh(newn.PlaneGeometry(1,1),newn.ShaderMaterial({vertexShader:nn,fragmentShader:tn,transparent:!0,uniforms:{u_texture:{value:a},u_textureResolution:{value:newn.Vector2(0,0)},u_resolution:{value:newn.Vector2(0,0)},u_borderRadius:{value:t.boderRadius[e]?t.boderRadius[e]:0}}}));o.add(l)})},on=()=>{constt=u.useRef([]),s=u.useRef([]);returnu.useCallback(({isIntersectingRef:a,isIntersectingOnceRef:e,params:l})=>{t.current.length>0&&t.current.forEach((f,r)=>{f.unobserve(s.current[r])}),s.current=[],t.current=[];constv=newArray(l.dom.length).fill(!1);a.current=[...v],e.current=[...v],l.dom.forEach((f,r)=>{constc=p=>{p.forEach(d=>{l.onIntersect[r]&&l.onIntersect[r](d),a.current[r]=d.isIntersecting})},m=newIntersectionObserver(c,{rootMargin:"0px",threshold:0});m.observe(f),t.current.push(m),s.current.push(f)})},[])},un=()=>{constt=u.useRef([]),s=u.useCallback(({params:o,size:a,resolutionRef:e,scene:l,isIntersectingRef:v})=>{l.children.length!==t.current.length&&(t.current=newArray(l.children.length)),l.children.forEach((f,r)=>{constc=o.dom[r];if(!c){W&&console.warn("DOM is null.");return}constm=c.getBoundingClientRect();if(t.current[r]=m,f.scale.set(m.width,m.height,1),f.position.set(m.left+m.width*.5-a.width*.5,-m.top-m.height*.5+a.height*.5,0),v.current[r]&&(o.rotation[r]&&f.rotation.copy(o.rotation[r]),finstanceofn.Mesh)){constp=f.material;i(p,"u_texture",o.texture[r]),i(p,"u_textureResolution",o.resolution[r]),i(p,"u_resolution",e.current.set(m.width,m.height)),i(p,"u_borderRadius",o.boderRadius[r]?o.boderRadius[r]:0)}})},[]);return[t.current,s]},an=()=>{constt=u.useRef([]),s=u.useRef([]),o=u.useCallback((a,e=!1)=>{t.current.forEach((v,f)=>{v&&(s.current[f]=!0)});constl=e?[...s.current]:[...t.current];returna<0?l:l[a]},[]);return{isIntersectingRef:t,isIntersectingOnceRef:s,isIntersecting:o}},sn=t=>({onView:o,onHidden:a})=>{conste=u.useRef(!1);u.useEffect(()=>{letl;constv=()=>{t.current.some(f=>f)?e.current||(o&&o(),e.current=!0):e.current&&(a&&a(),e.current=!1),l=requestAnimationFrame(v)};returnl=requestAnimationFrame(v),()=>{cancelAnimationFrame(l)}},[o,a])},ne={texture:[],dom:[],resolution:[],boderRadius:[],rotation:[],onIntersect:[]},ln=({size:t,dpr:s,samples:o=0},a=[],e)=>{constl=u.useMemo(()=>newn.Scene,[]),v=b(t),[f,r]=C({scene:l,camera:v,size:t,dpr:s,samples:o,isSizeUpdate:!0}),[c,m]=D({...ne,updateKey:e}),[p,d]=un(),g=u.useRef(newn.Vector2(0,0)),[h,y]=u.useState(!0);u.useEffect(()=>{y(!0)},a);constM=u.useRef(null),_=u.useMemo(()=>newn.Texture,[]),T=on(),{isIntersectingOnceRef:P,isIntersectingRef:A,isIntersecting:E}=an(),R=sn(A);return[u.useCallback((z,k)=>{const{gl:j,size:V}=z;if(k&&m(k),en(c))return_;if(h){if(M.current===c.updateKey)return_;M.current=c.updateKey}returnh&&(rn({params:c,size:V,scene:l}),T({isIntersectingRef:A,isIntersectingOnceRef:P,params:c}),y(!1)),d({params:c,size:V,resolutionRef:g,scene:l,isIntersectingRef:A}),r(j)},[r,m,T,d,h,l,c,P,A,_]),m,{scene:l,camera:v,renderTarget:f,output:f.texture,isIntersecting:E,DOMRects:p,intersections:A.current,useDomView:R}]};varcn=`precision mediump float;
0 commit comments