Я вот подумал, что тут кое-чего не хватает
CODE:
<script>
sx = 200;sy = 300;amp = 150;
i = -100;l = 0;k=0;
a=11;
c=[0,0,0];cp=[1,-6,4]; // c+=cp //cp=[1,2,4]
n=null;f1=1;
function addpoint(x,y) {
//-----------------------n 1, 2
switch(n){
case 1: if(y<1){cp[1]=-cp[0]+1};break;
case 2:
if(x<y){c[0]=200}else{c[0]=0;c[1]=150}
if(x==y){c[1]=c[0]-50}else{c[0]=c[2]+150}
if(x<2){cp[2]=-cp[1]-cp[0]}
//if(y<1){cp[1]=-cp[0]+1}
if(y==x){cp[0]=cp[1]+1}
if(x<y/*&&f1*/){cp[0]=-cp[0];c[0]=-c[1];f1=0}else{f1=1}
break;
default: break;
}
//------------------------- color
for(var ii=0;ii<3;ii++){
c[ii]+=cp[ii];
if(c[ii]>255){c[ii]=255+(255-c[ii]);cp[ii]=-cp[ii]}
if(c[ii]<0){c[ii]=-c[ii];cp[ii]=-cp[ii]}
}
//-------------------------
document.write('<div style="position:absolute;width:1px;height:1px;left:'+ (sx+x) +'px;top:'+(sy+y)+'px;margin:0px;padding:0px"><font color="rgb('+ c.join(',') +')">.</font></div>');
}
function jsWr(n1){
n=n1;
while(l<1.2){
i = -100;
while(i<100){
k+=0.05; i++; addpoint(amp*Math.cos(k),amp*Math.sin(k)*Math.cos(i/10));
}
l=l+0.1; k=l
}
}
jsWr(1);
//jsWr(2)
</script>
|