PageSourceSearch

https://softera.ai/assets/shooting-stars-Bwq8B9kT.js

js softera.ai collected 2026-10-05 15:08:04 UTC 2,479 bytes, 1 lines download raw bytes

1import{d as q,r as m,j as H,a as N}from"./index-CLXOTad6.js";const X=({className:E})=>{const{isDark:g}=q(),y=m.useRef(null),b=m.useRef(g);return m.useEffect(()=>{b.current=g},[g]),m.useEffect(()=>{const o=y.current;if(!o)return;let S,p,x;return S=setTimeout(()=>{const t=o.getContext("2d");if(!t)return;const M=()=>{o.width=window.innerWidth,o.height=window.innerHeight,z()},k=22,r=[],h=[],z=()=>{r.length=0;for(let s=0;s<k;s++)r.push({x:Math.random()*o.width,y:Math.random()*o.height,r:.7+Math.random()*1.4,phase:Math.random()*Math.PI*2,speed:.4+Math.random()*1.2,baseOpacity:.25+Math.random()*.45})};M(),window.addEventListener("resize",M);let $=performance.now(),w=0,v=900+Math.random()*1100;const C=s=>{const D=Math.min((s-$)/1e3,.05);$=s,t.clearRect(0,0,o.width,o.height);const F=b.current,i=F?"147,197,253":"224,30,90",P=F?"191,219,254":"255,107,157";for(let a=h.length-1;a>=0;a--){const e=h[a];if(e.life+=D,e.life>=e.maxLife){h.splice(a,1);continue}const n=e.life/e.maxLife,l=1-Math.pow(1-n,3),A=n<.2?n/.2:n>.65?1-(n-.65)/.35:1,u=e.alpha*A,T=l*e.speed*e.maxLife,d=e.ox+e.nx*T,f=e.oy+e.ny*T,I=d-e.nx*e.length,L=f-e.ny*e.length,c=t.createLinearGradient(I,L,d,f),j=(u*.3).toFixed(3),O=(u*.8).toFixed(3),R=u.toFixed(3);c.addColorStop(0,`rgba(${P},0)`),c.addColorStop(.35,`rgba(${P},${j})`),c.addColorStop(.75,`rgba(${i},${O})`),c.addColorStop(1,`rgba(${i},${R})`),t.save(),t.strokeStyle=c,t.lineWidth=1.6,t.lineCap="round",t.beginPath(),t.moveTo(I,L),t.lineTo(d,f),t.stroke(),t.beginPath(),t.arc(d,f,1.4,0,Math.PI*2),t.fillStyle=`rgba(${i},${R})`,t.fill(),t.restore()}for(const a of r){const e=Math.sin(s*.001*a.speed+a.phase),n=a.baseOpacity*(.55+.45*e),l=a.r*(.85+.15*e);t.beginPath(),t.arc(a.x,a.y,l*4.5,0,Math.PI*2),t.fillStyle=`rgba(${i},${(n*.12).toFixed(2)})`,t.fill(),t.beginPath(),t.arc(a.x,a.y,l,0,Math.PI*2),t.fillStyle=`rgba(${i},${Math.min(n+.2,1).toFixed(2)})`,t.fill()}if(s-w>v&&r.length){w=s,v=900+Math.random()*1100;const a=r[Math.floor(Math.random()*r.length)],n=Math.random()*360*(Math.PI/180);h.push({ox:a.x,oy:a.y,nx:Math.cos(n),ny:Math.sin(n),speed:280+Math.random()*220,length:55+Math.random()*75,alpha:.65+Math.random()*.35,life:0,maxLife:.8+Math.random()*.9})}p=requestAnimationFrame(C)};p=requestAnimationFrame(C),x=M},0),()=>{clearTimeout(S),cancelAnimationFrame(p),x&&window.removeEventListener("resize",x)}},[]),H.jsx("canvas",{ref:y,className:N("fixed inset-0 pointer-events-none shooting-stars-container z-[1]",E)})};export{X as ShootingStars};

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.