void setup() {
size(728,90);

}

int c=60;
int cb=195;
int cf=60;
int cbf=30;

int run0=0;
int run1=0;
int red=255;
int green=0;
int red1=255;
int green1=0;

  float    mouseovery=0; 
float mouseoverx=0;
int once=0;
  void draw() {
    
    
  mouseovery = mouseY;
  mouseoverx = mouseX;
  if(mousePressed&&once==0){
    
   if(red1<=10&&green1>=200){once=1; ; link("https://www.klamm.de/?refid=507075");}
    red1--;
    green1++;
      red--;
    green++;
    if(red<0){red=0;}
    if(green>254){green=255;}
 //   red1=red;green1=green;
  }else {red=c;green=c;red1=255;green1=0; }
  
  if(run0==1){

if(cb>=200){cbf=cbf+(int)random(-2,3);cb=cb+cbf*(int)mouseoverx/150;}else  {cbf=cbf+(int)random(-2,5);cb=cb+cbf*(int)mouseoverx/100;;}


if(cb>=254){run0=0;cb=255;cbf=0;}
    fill(cb);
    rect(0,0,728,90);
  }
  
  
  if(run0!=1){
 
  if(cb<=70){cbf=cbf+(int)random(-3,2);cb=cb+cbf*(int)mouseovery/150;;}else { cbf=cbf+(int)random(-5,2);cb=cb+cbf*(int)mouseovery/100;;}
    if(cb<=1){run0=1;cb=0;cbf=0;}
    fill(cb);
    rect(0,0,728,90);
  }
  
  
  
  
  if(run1==0){    
if(c>=200){cf=cf+(int)random(-2,3);c=c+cf*(int)mouseoverx/100;;}else { cf=cf+(int)random(-2,5);c=c+cf*(int)mouseoverx/150;;}


if(c>=255){run1=1;c=255;cf=0;}

  fill(red,green,red);

    textSize(50);
   
   if(red1>=230)text("www.klamm.de Lass dich Bezahlen!" ,mouseoverx/3-130 ,70);else
  
   
    
    if(red1>=180) text("www.klamm.de Ready!" ,mouseoverx/3-200 ,70);else
    if(red1>100) text("www.klamm.de Steady!" ,mouseoverx/3-200 ,70);else
        if(red1>=0) text("www.klamm.de GO!" ,mouseoverx/3-200 ,70);
    
    
  }
  if(run1==1){    
  if(c<=50){cf=cf+(int)random(-3,2);c=c+cf*(int)mouseovery/100;}else { cf=cf+(int)random(-5,2);c=c+cf*(int)mouseovery/150;;}
    if(c<=0){run1=0;c=0;cf=0;}


  fill(red,green,red);

    textSize(50);
   
   if(red1>=230)text("www.klamm.de Lass dich Bezahlen!" ,mouseoverx/3-130 ,70);else
  
   
    
    if(red1>=180) text("www.klamm.de Ready!" ,mouseoverx/3-200 ,70);else
    if(red1>100) text("www.klamm.de Steady!" ,mouseoverx/3-200 ,70);else
        if(red1>=0) text("www.klamm.de GO!" ,mouseoverx/3-200 ,70);
    
    
  }
  
 
  if(mousePressed){
        strokeWeight(1);
        stroke(0, 255,0);
        //translate(20, 20, 20);
        line (0,0, mouseoverx, mouseovery);  
        line (728,0, mouseoverx, mouseovery); 
        line (728,90, mouseoverx, mouseovery); 
        line (0,90, mouseoverx, mouseovery); 
        
        float winkel;
        float laenge; 
        float dx;  
        float dy;  
        stroke(255, 200);  
        strokeWeight(2);  
        smooth(); 
        int i=0;
        
    while ( i < red1/2-mouseoverx/mouseovery) { 
        
                 
 

  
     
   float dz=0;
    
      i++;  
        winkel = random(3*PI);    
        laenge = random(min(abs(width/2), height));   
        dx = cos(winkel*mouseoverx/mouseovery)*laenge;   
        dy = sin(winkel*mouseoverx/mouseovery)* laenge; 
          dz = tan(winkel)* laenge; 
              stroke(dy+laenge+red+mouseoverx/mouseovery,dx+laenge+red1+mouseoverx/mouseovery,dz+laenge+green+mouseoverx/mouseovery,170+mouseoverx/mouseovery);
         

        line (40+cb+dx-c+mouseoverx, 40+green+dy-cb+mouseovery,abs(mouseoverx) , abs(mouseovery));  
      noStroke();
  fill(0);
  

  
  
      }
}
  
  }
