PageSourceSearch

https://graphek.de/wp-content/themes/graphek4/partials/particles/particles.min.js?t=1790323088

js graphek.de collected 2026-10-07 01:52:19 UTC 15,244 bytes, 1 lines download raw bytes

1window.initParticles=function(t,q,s){const R=document.getElementById(t),l=document.getElementById(t+"_src");if(!R||!l)return;const X=R.getContext("2d"),i=window.devicePixelRatio||1,Y=s||getComputedStyle(R.closest(".modul")||document.documentElement).getPropertyValue("--color_typo_strong").trim()||"#151515";let H=[],B=[],_={},h={x:-9999,y:-9999},G=!0,O=0,V=0,I=0;const r=window.matchMedia("(hover: hover)").matches,U=1e3/60;let J=0,j=0,A=0,K=null,N=[],T={left:!1,right:!1,up:!1,space:!1},Q=[],Z=[],k=0,$=[],E=0,tt=[];class y{constructor(t,i){this.originX=t,this.originY=i,this.x=t,this.y=i,this.vx=0,this.vy=0,this.phase=Math.random()*Math.PI*2,this.size=q.particleSizeMin+Math.random()*(q.particleSizeMax-q.particleSizeMin),this.destroyed=!1,this.respawnTimer=0,this.opacity=1}update(t,i){if(this.destroyed)return n?void 0:(this.respawnTimer-=i,void(this.respawnTimer<=0&&(this.destroyed=!1,this.x=this.originX,this.y=this.originY,this.vx=0,this.vy=0,this.opacity=0)));this.opacity<1&&(this.opacity=Math.min(1,this.opacity+.02*i)),r&&!n&&(a=this.x-h.x,e=this.y-h.y,(s=Math.sqrt(a*a+e*e))<q.mouseRadius)&&(e=Math.atan2(e,a),a=(q.mouseRadius-s)/q.mouseRadius*q.mouseForce,this.vx+=Math.cos(e)*a*i,this.vy+=Math.sin(e)*a*i),K&&(s=this.x-K.x,e=this.y-K.y,(a=Math.sqrt(s*s+e*e))<q.shipRadius)&&(e=Math.atan2(e,s),s=(q.shipRadius-a)/q.shipRadius*q.shipForce,this.vx+=Math.cos(e)*s*i,this.vy+=Math.sin(e)*s*i),this.vx+=Math.cos(t*q.idleSpeed+this.phase)*q.idleAmplitude*.01*i,this.vy+=Math.sin(t*q.idleSpeed*.7+this.phase)*q.idleAmplitude*.01*i,this.vx+=(this.originX-this.x)*q.returnSpeed*i,this.vy+=(this.originY-this.y)*q.returnSpeed*i;var e,s,a=Math.pow(q.friction,i);this.vx*=a,this.vy*=a,this.x+=this.vx*i,this.y+=this.vy*i}}class o{constructor(t,i){this.x=Math.random()*t,this.y=Math.random()*i,this.vx=(Math.random()-.5)*q.ambientSpeed*2,this.vy=(Math.random()-.5)*q.ambientSpeed*2,this.phase=Math.random()*Math.PI*2,this.size=q.particleSizeMin+Math.random()*(q.particleSizeMax-q.particleSizeMin),this.depth=Math.random(),this.blur=3*this.depth,this.alpha=1-.5*this.depth,this.destroyed=!1,this.respawnT
1imer=0}update(t){var i;if(this.destroyed)return n?void 0:(this.respawnTimer-=t,void(this.respawnTimer<=0&&(this.destroyed=!1,this.x=Math.random()<.5?-this.size:O+this.size,this.y=Math.random()*V,i=Math.atan2(V/2-this.y,O/2-this.x),this.vx=Math.cos(i)*q.ambientSpeed,this.vy=Math.sin(i)*q.ambientSpeed)));if(r&&!n){var e=this.x-h.x,s=this.y-h.y,a=Math.sqrt(e*e+s*s);if(a<q.mouseRadius){const i=Math.atan2(s,e);s=(q.mouseRadius-a)/q.mouseRadius*(null!=q.ambientMouseForce?q.ambientMouseForce:q.mouseForce);this.vx+=Math.cos(i)*s*t,this.vy+=Math.sin(i)*s*t}}if(K){e=this.x-K.x,a=this.y-K.y,s=Math.sqrt(e*e+a*a);if(s<q.shipRadius){const i=Math.atan2(a,e);a=(q.shipRadius-s)/q.shipRadius*(null!=q.ambientMouseForce?q.ambientMouseForce:q.shipForce);this.vx+=Math.cos(i)*a*t,this.vy+=Math.sin(i)*a*t}}Math.sqrt(this.vx*this.vx+this.vy*this.vy)>q.ambientSpeed&&(i=Math.pow(.95,t),this.vx*=i,this.vy*=i),this.x+=this.vx*t,this.y+=this.vy*t,this.x<-this.size&&(this.x=O+this.size),this.x>O+this.size&&(this.x=-this.size),this.y<-this.size&&(this.y=V+this.size),this.y>V+this.size&&(this.y=-this.size)}}class d{constructor(t,i){this.x=t,this.y=i,this.vx=Math.cos(Math.random()*Math.PI*2)*q.shipIdleDrift,this.vy=Math.sin(Math.random()*Math.PI*2)*q.shipIdleDrift,this.angle=Math.atan2(this.vy,this.vx),this.destroyed=!1}update(t,i){t.left&&(this.angle-=q.shipRotateSpeed*i),t.right&&(this.angle+=q.shipRotateSpeed*i),t.up&&(this.vx+=Math.cos(this.angle)*q.shipThrustPower*i,this.vy+=Math.sin(this.angle)*q.shipThrustPower*i),this.vx+=Math.cos(this.angle)*q.shipIdleDrift*.01*i,this.vy+=Math.sin(this.angle)*q.shipIdleDrift*.01*i;t=Math.pow(q.shipFriction,i),this.vx*=t,this.vy*=t,t=Math.sqrt(this.vx*this.vx+this.vy*this.vy);t>q.shipMaxSpeed&&(this.vx=this.vx/t*q.shipMaxSpeed,this.vy=this.vy/t*q.shipMaxSpeed),this.x+=this.vx*i,this.y+=this.vy*i,this.x>O+q.shipSize?this.x=-q.shipSize:this.x<-q.shipSize&&(this.x=O+q.shipSize),this.y>V+q.shipSize?this.y=-q.shipSize:this.y<-q.shipSize&&(this.y=V+q.shipSize)}}class it{constructor(t){var i=(Math.random()-.5)*(Math.PI/6),i=t.angle+Math.PI+i;this.x=t.x+Math.cos(t.angle+Math.PI)*q.shipSize,this.y=t.y+Math.sin(t.angle+Math.PI)*q.shipSize,this.vx=Math.cos(i)*(.5+.5*Math.random()),this.vy=Math.sin(i)*(.5+.5*Math.random()),this.life=q.shipThrustLifespan,this.maxLife=q.shipThrustLifespan,this.radius=1+1.5*Math.random()}update(t){this.x+=this.vx*t,this.y+=this.vy*t,this.life-=t}}class et{constructor(t){this.x=t.x+Math.cos(t.angle)*q.shipSize,this.y=t.y+Math.sin(t.angle)*q.shipSize,this.vx=Math.cos(t.angle)*q.bulletSpeed,this.vy=Math.sin(t.angle)*q.bulletSpeed,this.radius=q.bulletRadius,this.alive=!0}update(t){this.x+=this.vx*t,this.y+=this.vy*t,(this.x<-this.radius||this.x>O+this.radius||this.y<-this.radius||this.y>V+this.radius)&&(this.alive=!1)}}class L{constructor(t,i){var e=Math.random()*Math.PI*2,s=.5+2*Math.random();this.x=t,this.y=i,this.vx=Math.cos(e)*s,this.vy=Math.sin(e)*s,this.life=q.explosionLifespan,this.maxLife=q.explosionLifespan,this.radius=1+2*Math.random()}update(t){this.x+=this.vx*t,this.y+=this.vy*t,this.life-=t}}class F{constructor(t,i,e,s,a,h){this.x=t,this.y=i,this.vx=e,this.vy=s,this.radius=null!=a?a:q.asteroidMinRadius+Math.random()*(q.asteroidMaxRadius-q.asteroidMinRadius),this.color=h||(Math.random()<.5?"#871EFF":"#74F5A1"),this.rotation=Math.random()*Math.PI*2,this.angleVel=.02*(Math.random()-.5),this.alive=!0;t=(this.radius-.5*q.asteroidMinRadius)/(q.asteroidMaxRadius-.5*q.asteroidMinRadius);this.points=Math.max(5,Math.round(t*q.asteroidPoints))}update(t){this.x+=this.vx*t,this.y+=this.vy*t,this.rotation+=this.angleVel*t,(this.x<2*-this.radius||this.x>O+2*this.radius||this.y<2*-this.radius||this.y>V+2*this.radius)&&(this.alive=!1)}}class W{constructor(t,i,e,s){this.x=t,this.y=i,this.points=e,this.color=s||null,this.life=60,this.maxLife=60,this.vy=-1.2,this.fontSize=Math.min(12+.6*e,36)}update(t){this.y+=this.vy*t,this.vy*=Math.pow(.98,t),this.life-=t}}function e(){var e,s=O,a=V,h=R.parentElement.getBoundingClientRect();if(O=Math.round(h.width),V=Math.round(h.height),R.width=O*i,R.height=V*i,R.style.width=O+"px",R.style.height=V+"px",X.setTransform(i,0,0,i,0,0),_={},O<=0||V<=0)H=[],B=[];
1else if(l.complete&&0<l.naturalWidth&&(H=function(t){var i=(a=document.createElement("canvas")).getContext("2d"),e=O*(q.svgMaxWidth/100),s=V*(q.svgMaxHeight/100),e=Math.min(e/t.naturalWidth,s/t.naturalHeight),s=Math.round(t.naturalWidth*e),e=Math.round(t.naturalHeight*e),a=(a.width=O,a.height=V,O*(q.svgX/100)),h=V*(q.svgY/100),a=Math.round(Math.min(Math.max(0,a-s/2),O-s)),h=Math.round(Math.min(Math.max(0,h-e/2),V-e));i.drawImage(t,a,h,s,e);var r=(t=i.getImageData(0,0,O,V)).data,n=[],a=null!=q.particleGap?q.particleGap:1,o=q.particleSizeMax+a,l=.866*o,d=.15*q.particleSizeMin;for(let i=0;i*l<V;i++){var u=i%2?.5*o:0;for(let t=0;t*o+u<O;t++){var p=Math.round(t*o+u),v=Math.round(i*l);p>=O||v>=V||128<r[3+4*(v*O+p)]&&(p=p+(Math.random()-.5)*d,v=v+(Math.random()-.5)*d,n.push(new y(p,v)))}}return n}(l)),B=function(){var i=q.ambientCount||0,e=[];for(let t=0;t<i;t++)e.push(new o(O,V));return e}(),q.ship){if(K)0<s&&0<a&&(K.x=K.x/s*O,K.y=K.y/a*V);else{let t=O/2,i=V/2;l.complete&&0<l.naturalWidth&&(h=O*(q.svgMaxWidth/100),s=V*(q.svgMaxHeight/100),a=Math.min(h/l.naturalWidth,s/l.naturalHeight),h=l.naturalWidth*a,s=l.naturalHeight*a,a=O*(q.svgX/100),e=V*(q.svgY/100),a=Math.min(Math.max(0,a-h/2),O-h),h=Math.min(Math.max(0,e-s),V-s),t=a,i=h+s/2),K=new d(t,i)}N=[]}}function st(e){I+=e;for(let t=0,i=B.length;t<i;t++)B[t].update(e);if(q.ship&&K){if(K.destroyed||K.update(T,e),!K.destroyed&&T.up)for(A+=q.shipThrustCount*e;1<=A;)N.push(new it(K)),--A;else A=0;for(let t=N.length-1;0<=t;t--)N[t].update(e),N[t].life<=0&&N.splice(t,1);K.destroyed||(k+=e,T.space&&k>=q.bulletFireRate&&(Q.push(new et(K)),k=0)),C&&!K.destroyed&&(E+=e)>=q.asteroidSpawnRate&&($.length>=q.asteroidMaxCount||(z=0===(z=Math.floor(4*Math.random()))?(t=Math.random()*O,-60):1===z?(t=O+60,Math.random()*V):2===z?(t=Math.random()*O,V+60):(t=-60,Math.random()*V),P=O*(.2+.6*Math.random()),b=V*(.2+.6*Math.random()),b=Math.atan2(b-z,P-t),P=q.asteroidMinSpeed+Math.random()*(q.asteroidMaxSpeed-q.asteroidMinSpeed),$.push(new F(t,z,Math.cos(b)*P,Math.sin(b)*P))),E=0);for(let t=Q.length-1;0<=t;t--)Q[t].update(e),Q[t].alive||Q.splice(t,1);for(let t=$.length-1;0<=t;t--)$[t].update(e),$[t].alive||$.splice(t,1);for(let t=Q.length-1;0<=t;t--){var s=Q[t];if(s.alive)for(let t=0,i=H.length;t<i;t++){var a=H[t];if(!a.destroyed){var h=s.x-a.x,r=s.y-a.y;if(Math.sqrt(h*h+r*r)<s.radius+.5*a.size){s.alive=!1,a.destroyed=!0,a.respawnTimer=q.particleRespawnDelay;for(let t=0;t<q.explosionCount;t++)Z.push(new L(a.x,a.y));tt.push(new W(a.x,a.y,1)),D&&D(1);break}}}}for(let t=Q.length-1;0<=t;t--){var n=Q[t];if(n.alive)for(let t=0,i=B.length;t<i;t++){var o=B[t];if(!o.destroyed){var l=n.x-o.x,d=n.y-o.y;if(Math.sqrt(l*l+d*d)<n.radius+.5*o.size){n.alive=!1,o.destroyed=!0,o.respawnTimer=q.particleRespawnDelay;for(let t=0;t<q.explosionCount;t++)Z.push(new L(o.x,o.y));tt.push(new W(o.x,o.y,1)),D&&D(1);break}}}}for(let t=Q.length-1;0<=t;t--){var i=Q[t];if(i.alive)for(let t=$.length-1;0<=t;t--){var u=$[t],p=i.x-u.x,v=i.y-u.y;if(Math.sqrt(p*p+v*v)<i.radius+u.radius){i.alive=!1,$.splice(t,1);for(let t=0;t<2*q.explosionCount;t++)Z.push(new L(u.x,u.y));tt.push(new W(u.x,u.y,u.points,u.color)),D&&D(u.points);p=q.asteroidMinRadius;if(u.radius>p){var y=.6<(u.radius-p)/(q.asteroidMaxRadius-p)?3:2,M=.5*u.radius,x=1.3*Math.sqrt(u.vx*u.vx+u.vy*u.vy);for(let t=0;t<y;t++){var c=2*Math.PI/y*t+.5*(Math.random()-.5),f=Math.cos(c)*x,c=Math.sin(c)*x;$.push(new F(u.x,u.y,f,c,M,u.color))}}break}}}if(!K.destroyed&&C){var m=.7*q.shipSize;for(let t=$.length-1;0<=t;t--){var g=$[t],w=K.x-g.x,S=K.y-g.y;if(Math.sqrt(w*w+S*S)<m+g.radius){for(let t=0;t<4*q.explosionCount;t++)Z.push(new L(K.x,K.y));K.destroyed=!0,R.dispatchEvent(new CustomEvent("shipDestroyed"));break}}}for(let t=Z.length-1;0<=t;t--)Z[t].update(e),Z[t].life<=0&&Z.splice(t,1);for(let t=tt.length-1;0<=t;t--)tt[t].update(e),tt[t].life<=0&&tt.splice(t,1)}var t,z,b,P;for(let t=0,i=H.length;t<i;t++)H[t].update(I,e)}function at(t){if(G){J=J||t;var i=Math.min(t-J,3*U);for(J=t,j+=i;j>=U;)st(1),j-=U;var e,s,a,h,r,n=j/U;X.clearRect(0,0,O,V),X.fillStyle=Y;for(let t=0,i=B.length;t<i;t++){var o,l,d,u=B[t];
1u.destroyed||(o=u.x+u.vx*n,l=u.y+u.vy*n,e=u.size,d=u.blur,u=u.alpha,r=h=a=s=void 0,r=e.toFixed(1)+"_"+d.toFixed(1)+"_"+u.toFixed(2),_[r]||(s=Math.ceil(2*d),s=Math.ceil(e)+2*s,(a=document.createElement("canvas")).width=s,a.height=s,h=a.getContext("2d"),0<d&&(h.filter="blur("+d+"px)"),h.globalAlpha=u,h.fillStyle=Y,h.beginPath(),h.arc(s/2,s/2,.5*e,0,2*Math.PI),h.fill(),_[r]={canvas:a,offset:s/2}),d=_[r],X.drawImage(d.canvas,o-d.offset,l-d.offset))}if(q.ship&&K){for(let t=0,i=N.length;t<i;t++){var p=N[t],v=p.x+p.vx*n,y=p.y+p.vy*n,M=1-p.life/p.maxLife,x=1-M,p=p.radius*(1-.5*M);X.globalAlpha=x,X.beginPath(),X.arc(v,y,p,0,2*Math.PI),X.fill()}X.globalAlpha=1;for(let t=0,i=Z.length;t<i;t++){var c=Z[t],f=c.x+c.vx*n,m=c.y+c.vy*n,g=1-c.life/c.maxLife,w=1-g,c=c.radius*(1-.5*g);X.globalAlpha=w,X.beginPath(),X.arc(f,m,c,0,2*Math.PI),X.fill()}X.globalAlpha=1;for(let t=0,i=tt.length;t<i;t++){var S=tt[t],z=S.y+S.vy*n,b=S.life/S.maxLife;X.globalAlpha=b,X.font="bold "+S.fontSize+"px sans-serif",X.fillStyle=S.color||Y,X.textAlign="center",X.fillText("+"+S.points,S.x,z)}X.globalAlpha=1,X.fillStyle=Y;for(let t=0,i=Q.length;t<i;t++){var P=Q[t],R=P.x+P.vx*n,I=P.y+P.vy*n;X.beginPath(),X.arc(R,I,P.radius,0,2*Math.PI),X.fill()}for(let t=0,i=$.length;t<i;t++){var A=$[t],T=A.x+A.vx*n,k=A.y+A.vy*n,D=A.rotation+A.angleVel*n;X.save(),X.translate(T,k),X.rotate(D),X.beginPath();for(let t=0;t<8;t++){var E=2*Math.PI/8*t,L=Math.cos(E)*A.radius,E=Math.sin(E)*A.radius;0===t?X.moveTo(L,E):X.lineTo(L,E)}X.closePath(),X.lineJoin="round",X.lineWidth=q.asteroidStrokeWidth,X.strokeStyle=A.color,X.stroke(),X.restore()}K.destroyed||(t=K.x+K.vx*n,i=K.y+K.vy*n,X.save(),X.translate(t,i),X.rotate(K.angle),X.strokeStyle=Y,X.lineWidth=q.shipLineWidth,X.beginPath(),X.moveTo(q.shipSize,0),X.lineTo(-q.shipSize,-q.shipSize),X.lineTo(.5*-q.shipSize,0),X.lineTo(-q.shipSize,q.shipSize),X.closePath(),X.stroke(),X.restore())}for(let t=0,i=H.length;t<i;t++){var F,W,C=H[t];C.destroyed||(F=C.x+C.vx*n,W=C.y+C.vy*n,C.opacity<1?(X.globalAlpha=C.opacity,X.beginPath(),X.arc(F,W,.5*C.size,0,2*Math.PI),X.fill(),X.globalAlpha=1):(X.beginPath(),X.arc(F,W,.5*C.size,0,2*Math.PI),X.fill()))}}else J=0,j=0;requestAnimationFrame(at)}function a(){var t=R.parentElement.getBoundingClientRect();Math.round(t.width)===O&&Math.round(t.height)===V||e()}r&&(R.addEventListener("mousemove",t=>{var i=R.getBoundingClientRect();h.x=t.clientX-i.left,h.y=t.clientY-i.top}),R.addEventListener("mouseleave",()=>{h.x=-9999,h.y=-9999})),q.ship&&(document.addEventListener("keydown",t=>{G&&("ArrowLeft"===t.key&&(T.left=!0,t.preventDefault()),"ArrowRight"===t.key&&(T.right=!0,t.preventDefault()),"ArrowUp"===t.key&&(T.up=!0,t.preventDefault()),"ArrowDown"===t.key&&n&&t.preventDefault()," "===t.key)&&(T.space=!0,t.preventDefault())}),document.addEventListener("keyup",t=>{"ArrowLeft"===t.key&&(T.left=!1),"ArrowRight"===t.key&&(T.right=!1),"ArrowUp"===t.key&&(T.up=!1)," "===t.key&&(T.space=!1)})),new IntersectionObserver(t=>{(G=t[0].isIntersecting)&&a(),G||(T.left=!1,T.right=!1,T.up=!1,T.space=!1,n&&R.dispatchEvent(new CustomEvent("gameAutoEnd")))},{threshold:0}).observe(R);let u;function p(){e(),window.ResizeObserver&&new window.ResizeObserver(a).observe(R.parentElement),requestAnimationFrame(at)}window.addEventListener("resize",()=>{clearTimeout(u),u=setTimeout(e,150)});let n=!1,C=!1,D=null;const v=q.svgX,M=q.svgY;function x(t,i,e,s){if(!l.complete||0===l.naturalWidth)return{dx:0,dy:0};var a=O*(q.svgMaxWidth/100),h=V*(q.svgMaxHeight/100),a=Math.min(a/l.naturalWidth,h/l.naturalHeight);const r=Math.round(l.naturalWidth*a),n=Math.round(l.naturalHeight*a);function o(t,i){t=O*(t/100),i=V*(i/100);return{x:Math.round(Math.min(Math.max(0,t-r/2),O-r)),y:Math.round(Math.min(Math.max(0,i-n/2),V-n))}}h=o(t,i),a=o(e,s);return{dx:a.x-h.x,dy:a.y-h.y}}window.particlesAPI=window.particlesAPI||{},window.particlesAPI[t]={enterGameMode:function(){if(!n){var i=x(q.svgX,q.svgY,50,50);for(let t=0;t<H.length;t++)H[t].originX+=i.dx,H[t].originY+=i.dy;q.svgX=50,q.svgY=50,$=[],E=0,tt=[],n=!0}},exitGameMode:function(){if(n){var i=x(50,50,v,M);for(let t=0;t<H.length;t++)H[t].originX+=i.dx,H[t].originY+=i.dy,H[t].destroyed&&(H[t].destroyed=!1,H[t].x=H[t].originX,H[t].y=H[t].originY,H[t].vx=0,H[t].vy=0,H[t].opacity=0);q.svgX=v,q.svgY=M;for(let t=0;t<B.length;
1t++)B[t].destroyed&&(B[t].destroyed=!1,B[t].respawnTimer=0);$=[],E=0,tt=[],A=0,n=!1,C=!1,K&&(K.destroyed=!1)}},startRound:function(){C=!0},stopRound:function(){C=!1,$=[],E=0,Q=[]},resetShip:function(){K&&(K.destroyed=!1,K.x=O/2,K.y=V/2,K.vx=Math.cos(Math.random()*Math.PI*2)*q.shipIdleDrift,K.vy=Math.sin(Math.random()*Math.PI*2)*q.shipIdleDrift,K.angle=Math.atan2(K.vy,K.vx),Q=[],$=[],E=0,A=0)},setOnScore:function(t){D=t},getShipPosition:function(){return K?{x:K.x,y:K.y}:null}},l.complete&&0<l.naturalWidth?p():l.addEventListener("load",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.