PageSourceSearch

https://joaotome.com/assets/ParticleCloud-Bb5yXpKz.js

js joaotome.com collected 2026-09-24 18:12:34 UTC 5,425 bytes, 1 lines download raw bytes

1import{r as c,a as G}from"./index-OZBwOq0W.js";const ae=({src:o,alt:h})=>{const[g,a]=c.useState(!1);return G.jsx("img",{src:o,alt:h,className:"w-36 h-36 md:w-44 md:h-44 rounded-full border-2 border-white/10 object-cover shadow-lg transition-transform duration-300 ease-out",width:240,height:240,decoding:"async",style:{transform:g?"scale(1.05)":"scale(1)"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)})},D=["rgba(249, 115, 22, 0.5)","rgba(249, 115, 22, 0.35)"],U=["rgba(100, 180, 255, 0.4)","rgba(100, 180, 255, 0.3)"],W=["rgba(255, 255, 255, 0.25)","rgba(255, 255, 255, 0.15)"],V=120,y=60,te=3;function ne(){let o=0,h=0;for(;o===0;)o=Math.random();for(;h===0;)h=Math.random();return Math.sqrt(-2*Math.log(o))*Math.cos(2*Math.PI*h)}function re(){const o=Math.random();return o<.4?{color:D[Math.floor(Math.random()*D.length)],colorType:"orange"}:o<.8?{color:U[Math.floor(Math.random()*U.length)],colorType:"blue"}:{color:W[Math.floor(Math.random()*W.length)],colorType:"white"}}function oe(o,h){return Array.from({length:V},()=>{const g=112+ne()*20,a=Math.max(85,Math.min(150,g)),p=Math.random()*Math.PI*2,d=o+Math.cos(p)*a,l=h+Math.sin(p)*a,w=Math.random()<.2,{color:b,colorType:I}=re();return{homeX:d,homeY:l,x:d,y:l,size:w?4+Math.random()*2:2+Math.random()*4,color:b,colorType:I,blur:w,wanderPhaseX:Math.random()*Math.PI*2,wanderPhaseY:Math.random()*Math.PI*2,wanderSpeedX:.3+Math.random()*.5,wanderSpeedY:.3+Math.random()*.5,wanderAmpX:3+Math.random()*7,wanderAmpY:3+Math.random()*7,pushX:0,pushY:0}})}function se(o,h,g){const a={orange:[249,115,22],blue:[100,180,255],white:[255,255,255]},p=a[o.colorType],d=a[h.colorType],l=Math.round((p[0]+d[0])/2),w=Math.round((p[1]+d[1])/2),b=Math.round((p[2]+d[2])/2);return`rgba(${l}, ${w}, ${b}, ${g})`}const ie=({className:o})=>{const h=c.useRef(null),g=c.useRef(null),a=c.useRef([]),p=c.useRef({x:0,y:0,active:!1}),d=c.useRef(0),l=c.useRef(!1),w=c.useRef(!0),b=c.useRef(0),I=c.useRef({cx:0,cy:0});c.useEffect(()=>{w.current=window.matchMedia("(hover: hover)").matches},[]);const J=c.useCallback(f=>{if(!w.current)return;const t=f.target.getBoundingClientRect();p.current={x:f.clientX-t.left,y:f.clientY-t.top,active:!0}},[]),K=c.useCallback(()=>{p.current.active=!1},[]);return c.useEffect(()=>{const f=h.current;if(!f)return;const t=f.getContext("2d");if(!t)return;const C=()=>{const x=window.devicePixelRatio||1,m=f.getBoundingClientRect();f.width=m.width*x,f.height=m.height*x,t.setTransform(x,0,0,x,0,0);const v=m.width/2,R=m.height/2;I.current={cx:v,cy:R};const S=window.matchMedia("(max-width: 640px)").matches?72:V;g.current=oe(v,R).slice(0,S)};C();const Q=performance.now(),Y=x=>{const m=(x-Q)/1e3,{cx:v,cy:R}=I.current,S=v*2,Z=R*2;t.clearRect(0,0,S,Z);const r=g.current;if(!r){l.current&&(d.current=requestAnimationFrame(Y));return}const T=p.current,N=Math.sin(m*(Math.PI*2)/7)*8,ee=1+.2*Math.max(0,Math.sin(m*(Math.PI*2)/7));for(const e of r){const n=Math.sin(m*e.wanderSpeedX+e.wanderPhaseX)*e.wanderAmpX,i=Math.sin(m*e.wanderSpeedY+e.wanderPhaseY)*e.wanderAmpY,s=e.homeX-v,u=e.homeY-R,M=Math.sqrt(s*s+u*u)||1,P=s/M*N,L=u/M*N,z=e.homeX+n+P,F=e.homeY+i+L;if(T.active&&w.current){const O=z-T.x,q=F-T.y,X=Math.sqrt(O*O+q*q);if(X<80&&X>0){const $=1-X/80,H=$*$*60;e.pushX+=O/X*H*.15,e.pushY+=q/X*H*.15}}const A=Math.sqrt(e.pushX*e.pushX+e.pushY*e.pushY);A>60&&(e.pushX=e.pushX/A*60,e.pushY=e.pushY/A*60),e.pushX*=.97,e.pushY*=.97,e.x=z+e.pushX,e.y=F+e.pushY}for(let e=0;e<r.length;e++){const n=r[e];for(let i=e+1;i<r.length;i++){const s=r[i],u=n.x-s.x;if(u>y||u<-y)continue;const M=n.y-s.y;if(M>y||M<-y)continue;const P=Math.sqrt(u*u+M*M);if(P>=y)continue;const L=(1-P/y)*.15*ee;t.beginPath(),t.moveTo(n.x,n.y),t.lineTo(s.x,s.y),t.strokeStyle=se(n,s,L),t.lineWidth=.5+(1-P/y)*.5,t.stroke()}}if(m>b.current&&a.current.length<te){for(let e=0;e<10;e++){const n=Math.floor(Math.random()*r.length),i=Math.floor(Math.random()*r.length);if(n===i)continue;const s=r[n].x-r[i].x,u=r[n].y-r[i].y;if(Math.sqrt(s*s+u*u)<y){a.current.push({fromIdx:n,toIdx:i,progress:0,speed:1/30});break}}b.current=m+2+Math.random()*2}const _=[];for(const e of a.current){if(e.progress+=e.speed,e.progress>1)continue;const n=r[e.fromIdx],i=r[e.toIdx],s=n.x+(i.x-n.x)*e.progress,u=n.y+(i.y-n.y)*e.progress,M=e.progress<.8?.6:.6*(1-(e.progress-.8)/.2);t.beginPath(),t.arc(s,u,1.5,0,Math.PI*2),t.fillStyle=`rgba(255, 255, 255, ${M})`,t.fill(),_.push(e)}a.current=_;for(const e of r)t.save(),e.blur&&(t.filter="blur(1.5px)"),t.beginPath(),t.arc(e.x,e.y,e.size,0,Math.PI*2),t.fillStyle=e.color,t.fill(),t.restore(
1);l.current&&(d.current=requestAnimationFrame(Y))},B=()=>{l.current||document.hidden||(l.current=!0,d.current=requestAnimationFrame(Y))},E=()=>{l.current=!1,cancelAnimationFrame(d.current)},j=new IntersectionObserver(([x])=>{x.isIntersecting?window.matchMedia("(prefers-reduced-motion: reduce)").matches?(l.current=!0,d.current=requestAnimationFrame(()=>{l.current=!1,Y(performance.now())})):B():E()},{rootMargin:"120px"}),k=()=>{document.hidden?E():f.getBoundingClientRect().bottom>0&&f.getBoundingClientRect().top<window.innerHeight&&B()};return j.observe(f),document.addEventListener("visibilitychange",k),window.addEventListener("resize",C),()=>{E(),j.disconnect(),document.removeEventListener("visibilitychange",k),window.removeEventListener("resize",C)}},[]),G.jsx("canvas",{ref:h,className:o,onMouseMove:J,onMouseLeave:K,style:{width:"100%",height:"100%"}})};export{ae as B,ie as P};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.