PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 0.9.6
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v0.9.6
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
desktop-mode / assets / js / about-scene.min.js

about-scene.min.js in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 0.9.6, at assets/js/about-scene.min.js

2 lines 10.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(){"use strict";const x={sampleStride:2,alphaThreshold:64,maxParticles:8e3,logoFraction:.78,logoCenterY:.55,springK:.018,damping:.88,restVelocityEpsilon:.025,magnetRadius:220,magnetStrength:1600,magnetForceCap:1.6,dragRadius:140,dragStrength:.18,maxMouseDelta:80,shockwavePeak:14,shockwaveSpeed:22,shockwaveLifeFrames:75,boidsRadius:14,separationStrength:.01,alignmentStrength:.005,gridCell:18,sparkleCount:128,sparkleSpawnRate:.6,sparkleLifeFrames:80,brushSize:96,sparkleBrushSize:32,spriteScaleMin:.05,spriteScaleMax:.13,spriteAlphaMin:.55,spriteAlphaMax:.95,hueCycleFrames:420},j=[5162495,8031487,11889663,16735441,16744043,16765286,5036472,5162495],gt="radial-gradient(circle at 50% 35%, #1b3461 0%, #0c1733 55%, #050918 100%)";async function ut(a){const{container:t,logoUrl:i,prefersReducedMotion:n,labels:o}=a,e=window.PIXI;if(!e)throw new Error("[desktop-mode/about] window.PIXI is undefined; load the pixijs module before calling mountAboutScene().");const{homes:l,aspectRatio:d}=await vt(i),g=t.style.background;t.style.background=gt;const s=new e.Application;await s.init({resizeTo:t,backgroundAlpha:0,antialias:!0,autoDensity:!0,resolution:Math.min(window.devicePixelRatio||1,2)}),t.appendChild(s.canvas),Ft(s.canvas);const b=wt(e,x.brushSize),w=bt(e,x.sparkleBrushSize),F=new e.Container,A=new e.Container,k=new e.Container;s.stage.addChild(F),s.stage.addChild(A),s.stage.addChild(k);const E='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',D=tt(e,o.eyebrow,{fontFamily:E,fontSize:11,fill:10204671,fontWeight:"600",letterSpacing:4}),q=tt(e,o.title,{fontFamily:E,fontSize:38,fill:16777215,fontWeight:"300",letterSpacing:-.4}),R=tt(e,o.byline,{fontFamily:E,fontSize:14,fill:12634858,fontWeight:"400",fontStyle:"italic",letterSpacing:.3}),T=tt(e,o.version,{fontFamily:E,fontSize:11,fill:7306928,fontWeight:"500",letterSpacing:1}),M=tt(e,o.hint,{fontFamily:E,fontSize:10,fill:16777215,fontWeight:"500",letterSpacing:2.4});M.alpha=.5,k.addChild(D),k.addChild(q),k.addChild(R),k.addChild(T),k.addChild(M);const S=l.length,O=new Float32Array(S),I=new Float32Array(S),L=new Float32Array(S),B=new Float32Array(S),_=new Float32Array(S),et=new Float32Array(S),st=new Float32Array(S),ct=new Array(S);for(let f=0;f<S;f++){const r=new e.Sprite(b);r.anchor.set(.5),r.blendMode="add";const h=x.spriteScaleMin+Math.random()*(x.spriteScaleMax-x.spriteScaleMin);r.scale.set(h),r.alpha=x.spriteAlphaMin+Math.random()*(x.spriteAlphaMax-x.spriteAlphaMin),F.addChild(r),ct[f]=r,st[f]=Math.random()}const lt=[];for(let f=0;f<x.sparkleCount;f++){const r=new e.Sprite(w);r.anchor.set(.5),r.blendMode="add",r.visible=!1,A.addChild(r),lt.push({sprite:r,life:0,vx:0,vy:0})}let nt=NaN,pt=NaN,$=0,J=0;const dt=()=>{const f=s.canvas.clientWidth,r=s.canvas.clientHeight;if(f<=0||r<=0)return;const h=f*x.logoFraction,u=r*x.logoFraction*.45;let m=h,p=m/d;p>u&&(p=u,m=p*d);const y=(f-m)/2,H=r*x.logoCenterY-p/2,Y=Number.isNaN(nt)||$<=0||J<=0;if(!Y){const C=m/$,ht=p/J;for(let G=0;G<S;G++){const Rt=(L[G]-nt)/$,Lt=(B[G]-pt)/J;L[G]=y+Rt*m,B[G]=H+Lt*p,_[G]*=C,et[G]*=ht}}for(let C=0;C<S;C++)O[C]=y+l[C][0]*m,I[C]=H+l[C][1]*p,Y&&(L[C]=O[C],B[C]=I[C]);const W=f/2;D.x=W,D.y=Math.max(28,r*.1),q.x=W,q.y=Math.max(56,r*.18);const U=kt(f/760,.6,1.25);q.scale.set(U);const it=H+p;R.x=W,R.y=Math.min(r-70,it+40),T.x=W,T.y=Math.min(r-46,it+70),M.x=W,M.y=r-22,nt=y,pt=H,$=m,J=p};dt();const c=new ResizeObserver(()=>{const f=t.clientWidth,r=t.clientHeight;f>0&&r>0&&s.renderer.resize(f,r),dt();try{s.render()}catch{}});c.observe(t);let N=-1e6,X=-1e6,v=!1,P=0,V=0;const Q=[],ot=f=>{const r=s.canvas.getBoundingClientRect(),h=f.clientX-r.left,u=f.clientY-r.top;if(!(h>=0&&u>=0&&h<=r.width&&u<=r.height)){v=!1,N=-1e6,X=-1e6;return}if(v){const p=x.maxMouseDelta;P+=Math.max(-p,Math.min(p,h-N)),V+=Math.max(-p,Math.min(p,u-X))}N=h,X=u,v=!0},at=()=>{v=!1,N=-1e6,X=-1e6,P=0,V=0},rt=f=>{const r=s.canvas.getBoundingClientRect(),h=f.clientX-r.left,u=f.clientY-r.top;h<0||u<0||h>r.width||u>r.height||Q.push({x:h,y:u,age:0})};s.canvas.addEventListener("pointermove",ot,{passive:!0}),s.canvas.addEventListener("pointerleave",at),s.canvas.addEventListener("pointerdown",rt);let z=!n,K=0;const ft=()=>{const f=K%x.hueCycleFrames/x.hueCycleFrames;for(let r=0;r<S;r++){const h=ct[r];h.x=L[r],h.y=B[r];const m=(f+st[r])%1*(j.length-1),p=j[Math.floor(m)],y=j[Math.min(j.length-1,Math.floor(m)+1)];h.tint=Mt(p,y,m-Math.floor(m))}},Z=()=>{K++,z&&(mt(S,O,I,L,B,_,et,N,X,v,v?P:0,v?V:0,Q),yt(Q),xt(lt,L,B,S)),P=0,V=0,ft()};return s.ticker.add(Z),ft(),z||(s.renderer.render(s.stage),s.ticker.stop()),{destroy(){c.disconnect(),s.canvas.removeEventListener("pointermove",ot),s.canvas.removeEventListener("pointerleave",at),s.canvas.removeEventListener("pointerdown",rt);try{s.destroy({removeView:!0},{children:!0,texture:!0,textureSource:!0,context:!0})}catch{}try{b.destroy(!0)}catch{}try{w.destroy(!0)}catch{}t.style.background=g},setAnimating(f){z=f&&!n,z?s.ticker.start():s.ticker.stop()}}}function mt(a,t,i,n,o,e,l,d,g,s,b,w,F){const{springK:A,damping:k,magnetRadius:E,magnetStrength:D,magnetForceCap:q,dragRadius:R,dragStrength:T,shockwavePeak:M,shockwaveSpeed:S,shockwaveLifeFrames:O,boidsRadius:I,separationStrength:L,alignmentStrength:B,gridCell:_,restVelocityEpsilon:et}=x,st=E*E,ct=R*R,lt=et*et,nt=St(a,n,o,_),$=Math.sqrt(b*b+w*w)>.001,J=b*T,dt=w*T;for(let c=0;c<a;c++){const N=t[c]-n[c],X=i[c]-o[c];let v=N*A,P=X*A;if(s){const h=d-n[c],u=g-o[c],m=h*h+u*u;if(m<st&&m>4){const p=Math.sqrt(m);let y=D/m;y>q&&(y=q),v+=h/p*y,P+=u/p*y}}if($){const h=n[c]-d,u=o[c]-g,m=h*h+u*u;if(m<ct){const p=1-Math.sqrt(m)/R,y=p*p;v+=J*y,P+=dt*y}}for(let h=0;h<F.length;h++){const u=F[h],m=n[c]-u.x,p=o[c]-u.y,y=Math.sqrt(m*m+p*p),H=u.age*S,Y=u.age/O,W=(1-Y)*(1-Y),U=30+u.age*.5,it=Math.abs(y-H);if(it<U&&y>.01){const C=1-it/U,ht=M*C*W;v+=m/y*ht,P+=p/y*ht}}const V=Math.floor(n[c]/_),Q=Math.floor(o[c]/_);let ot=0,at=0,rt=0,z=0,K=0;const ft=I*I;for(let h=V-1;h<=V+1;h++)for(let u=Q-1;u<=Q+1;u++){const m=nt.get(h*100003+u);if(m)for(let p=0;p<m.length;p++){const y=m[p];if(y===c)continue;const H=n[c]-n[y],Y=o[c]-o[y],W=H*H+Y*Y;if(W<ft&&W>.01){const U=1/W;ot+=H*U,at+=Y*U,rt+=e[y],z+=l[y],K++}}}K>0&&(v+=ot*L,P+=at*L,v+=(rt/K-e[c])*B,P+=(z/K-l[c])*B);const Z=(e[c]+v)*k,f=(l[c]+P)*k;if(!s&&F.length===0&&Z*Z+f*f<lt&&N*N+X*X<.5){n[c]=t[c],o[c]=i[c],e[c]=0,l[c]=0;continue}e[c]=Z,l[c]=f,n[c]+=Z,o[c]+=f}}function St(a,t,i,n){const o=new Map;for(let e=0;e<a;e++){const l=Math.floor(t[e]/n),d=Math.floor(i[e]/n),g=l*100003+d,s=o.get(g);s?s.push(e):o.set(g,[e])}return o}function yt(a){for(let t=a.length-1;t>=0;t--)a[t].age++,a[t].age>=x.shockwaveLifeFrames&&a.splice(t,1)}function xt(a,t,i,n){let o=0,e=Math.random();for(;e<x.sparkleSpawnRate;)o++,e+=Math.random();for(let l=0;l<a.length&&o>0;l++)if(a[l].life<=0){const d=Math.floor(Math.random()*n),g=a[l].sprite;g.x=t[d],g.y=i[d],g.scale.set(.4+Math.random()*.5),g.alpha=1,g.tint=j[Math.floor(Math.random()*j.length)],g.visible=!0,a[l].life=x.sparkleLifeFrames,a[l].vx=(Math.random()-.5)*.3,a[l].vy=-.45-Math.random()*.4,o--}for(let l=0;l<a.length;l++){const d=a[l];if(d.life<=0)continue;d.life--,d.sprite.x+=d.vx,d.sprite.y+=d.vy;const g=d.life/x.sparkleLifeFrames;d.sprite.alpha=g*g;const s=.4+(1-g)*.4;d.sprite.scale.set(s),d.life<=0&&(d.sprite.visible=!1)}}function Mt(a,t,i){const n=Math.floor(a/65536),o=Math.floor(a/256)%256,e=a%256,l=Math.floor(t/65536),d=Math.floor(t/256)%256,g=t%256,s=Math.round(n+(l-n)*i),b=Math.round(o+(d-o)*i),w=Math.round(e+(g-e)*i);return s*65536+b*256+w}function wt(a,t){const i=document.createElement("canvas");i.width=t,i.height=t;const n=i.getContext("2d");if(!n)throw new Error("[desktop-mode/about] 2D canvas context unavailable.");const o=t/2,e=n.createRadialGradient(o,o,0,o,o,o);return e.addColorStop(0,"rgba(255, 255, 255, 1)"),e.addColorStop(.18,"rgba(255, 255, 255, 0.85)"),e.addColorStop(.42,"rgba(255, 255, 255, 0.28)"),e.addColorStop(.75,"rgba(255, 255, 255, 0.06)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),n.fillStyle=e,n.fillRect(0,0,t,t),a.Texture.from(i)}function bt(a,t){const i=document.createElement("canvas");i.width=t,i.height=t;const n=i.getContext("2d");if(!n)throw new Error("[desktop-mode/about] 2D canvas context unavailable.");const o=t/2,e=n.createRadialGradient(o,o,0,o,o,o*.5);e.addColorStop(0,"rgba(255, 255, 255, 1)"),e.addColorStop(.4,"rgba(255, 255, 255, 0.5)"),e.addColorStop(1,"rgba(255, 255, 255, 0)"),n.fillStyle=e,n.fillRect(0,0,t,t),n.globalCompositeOperation="lighter";const l=1.5;for(const d of[!1,!0]){const g=d?n.createLinearGradient(0,0,0,t):n.createLinearGradient(0,0,t,0);g.addColorStop(0,"rgba(255, 255, 255, 0)"),g.addColorStop(.5,"rgba(255, 255, 255, 0.85)"),g.addColorStop(1,"rgba(255, 255, 255, 0)"),n.fillStyle=g,d?n.fillRect(o-l,0,l*2,t):n.fillRect(0,o-l,t,l*2)}return a.Texture.from(i)}async function vt(a){const t=await Ct(a),i=600,n=t.naturalWidth/t.naturalHeight,o=n>=1?i:Math.round(i*n),e=n>=1?Math.round(i/n):i,l={homes:[],aspectRatio:1},d=document.createElement("canvas");d.width=o,d.height=e;const g=d.getContext("2d",{willReadFrequently:!0});if(!g)return l;g.drawImage(t,0,0,o,e);const s=g.getImageData(0,0,o,e).data;let b=o,w=e,F=0,A=0;const k=x.alphaThreshold;for(let M=0;M<e;M++)for(let S=0;S<o;S++)s[(M*o+S)*4+3]>k&&(S<b&&(b=S),S>F&&(F=S),M<w&&(w=M),M>A&&(A=M));if(b>F||w>A)return l;const E=F-b+1,D=A-w+1,q=E/D,R=[],T=x.sampleStride;for(let M=w;M<=A;M+=T){const S=(M-w)/T%2===0?0:T/2;for(let O=b;O<=F;O+=T){const I=Math.min(F,Math.round(O+S)),L=M;if(s[(L*o+I)*4+3]>k&&(R.push([(I-b)/E,(L-w)/D]),R.length>=x.maxParticles))return{homes:R,aspectRatio:q}}}return{homes:R,aspectRatio:q}}function Ct(a){return new Promise((t,i)=>{const n=new Image;n.crossOrigin="anonymous",n.onload=()=>t(n),n.onerror=()=>i(new Error(`Failed to load logo: ${a}`)),n.src=a})}function Ft(a){a.style.display="block",a.style.width="100%",a.style.height="100%"}function tt(a,t,i){return new a.Text({text:t,style:{fontFamily:i.fontFamily,fontSize:i.fontSize,fill:i.fill,fontWeight:i.fontWeight??"normal",fontStyle:i.fontStyle??"normal",letterSpacing:i.letterSpacing??0,align:"center"},resolution:2,anchor:{x:.5,y:.5}})}function kt(a,t,i){return a<t?t:a>i?i:a}window.desktopModeMountAboutScene=ut})();
2