| 1 import "dart:math" as l;import "dart:html" as q; main(){var g=q.query("#area");q
.window.setImmediate(new GB(g).start);}var EB=q.query("#fps");var m; FB( g){if(m
==null)m=g;m=g*0.05+m*0.95;EB.text="${m.round()} fps";}class GB{var canvas;var w
idth;var height;var o;var t;GB(this.canvas);start(){var v=canvas.parent.client;w
idth=v.width;height=v.height;canvas.width=width;final BB=new n(this,"orange",0.3
82,0.387,0.241);final QB=new n(this,"green",0.949,0.723,0.615);o=new n(this,"#ff
2",14.0)..i(BB)..i(QB);final RB=new n(this,"#33f",1.0,1.0,1.0);final SB=new n(th
is,"gray",0.2,0.14,0.075);final TB=new n(this,"red",0.532,1.524,1.88);o.i(RB..i(
SB)..i(TB));HB(o,150);final g=0.1;final h=1/1500.0;final j=1/72.0;final UB=new n
(this,"gray",4.0,5.203,11.86);final VB=new n(this,"gray",3.6*g,421*h,1.769*j);fi
nal WB=new n(this,"gray",3.1*g,671*h,3.551*j);final XB=new n(this,"gray",5.3*g,1
070*h,7.154*j);final YB=new n(this,"gray",4.8*g,1882*h,16.689*j);o.i(UB..i(VB)..
i(WB)..i(XB)..i(YB));DB();} s( cB){var g=new DateTime.now().millisecondsSinceEpo
ch;if(t!=null)FB(1000/(g-t));t=g;var h=canvas.context2D;KB(h);MB(h);DB();} KB( g
){g.clearRect(0,0,width,height);} MB( g){o.s(g,new l.Point(width/2,height/2));}
DB(){q.window.requestAnimationFrame(s);} HB( v, BB){var g=new l.Random();for(int
h=0;h<BB;h++ ){var j=2.06+g.nextDouble()*(3.27-2.06);v.i(new n(this,"#777",0.1*
g.nextDouble(),j,j*2));}} OB( g)=>g*(width/10.0); PB( g)=>l.log(g+1)*(width/100.
0);}class n{final color;final orbitPeriod;final u;var k;var orbitRadius;var A
B;final CB=<n>[] ;n(this.u,this.color,this.k,[this.orbitRadius=0.0,this.orbitPe
riod=0.0]){k=u.PB(k);orbitRadius=u.OB(orbitRadius);AB=JB(orbitPeriod);} i( g){CB
.add(g);} s( g, j){var h=IB(j);NB(g,h);LB(g,h);} NB( h, g){if(g.x+k<0||g.x-k>=h.
canvas.width)return;if(g.y+k<0||g.y-k>=h.canvas.height)return;h..lineWidth=0.5..
fillStyle=color..strokeStyle=color;if(k>=2.0){h..shadowOffsetX=2..shadowOffsetY=
2..shadowBlur=2..shadowColor="#ddd";}h..beginPath()..arc(g.x,g.y,k,0,l.PI*2,fals
e)..fill()..closePath();h..shadowOffsetX=0..shadowOffsetY=0..shadowBlur=0;h..beg
inPath()..arc(g.x,g.y,k,0,l.PI*2,false)..fill()..closePath()..stroke();} LB( g,
h){for(var j in CB)j.s(g,h);} JB( g)=>g==0.0?0.0:1/(60.0*24.0*2*g); IB( g){if(AB
==0.0)return g;var h=u.t*AB;return new l.Point(orbitRadius*l.cos(h)+g.x,orbitRad
ius*l.sin(h)+g.y);}}class ZB{const ZB();}class aB{final name;const aB(this.name
);}class bB{const bB();} |