> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.RefPjPtTI$e/rev.1
 * 
 * authors: 
 *   Debora Pequito

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



float r;

// parametros da linha centrada
float lc_x1 = 170;
float lc_y1 = 350;
float lc_x2 = 230;
float lc_y2 = 60;

// velocidade da ellipse que percorre a linha centrada
// (oscilações por segundo)
float lc_v = 0.3;

// parametros da linha que cruza a linha centrada em baixo
float lcb_x1 = 85;
float lcb_y1 = 255;
float lcb_x2 = 275;
float lcb_y2 = 330;

// velocidade da ellipse que percorre a linha que cruza a 
// linha centrada em baixo (oscilações por segundo)
float lcb_v = 0.1;

void setup() {
  size(380, 430);
}

void draw() {
  background(220, 192, 152);

  float t = millis() / 1000.0;
  r = random (255);
  
  beginShape();
  fill(255, 172, 97, 100);
  noStroke();
  vertex(370, 0);
  vertex(400, 0);
  vertex(60, 400);
  vertex (0, 480);
  vertex(0, 300);
  endShape(CLOSE);             
  //risco amarelo

  beginShape();
  fill(r, 100, 112, 180);
  noStroke();
  vertex(20, 0);
  vertex(90, 0);
  vertex(width, height - 159);
  vertex(width, height);
  endShape(CLOSE);            
  //risco azul 

  noFill();
  stroke (0);
  strokeWeight(20);
  ellipse (190, 210, 340, 350);
  //elipse principal - sem fundo+contorno preto

  fill(67, 100, 112, 180);
  stroke (0);
  strokeWeight(0.5);
  ellipse (185, 235, 120, 120);
  //elipse azul

  fill(248, 210, 80, 100);
  stroke (0);
  strokeWeight(0.5);
  ellipse (155, 260, 87, 87);  
  //elipse amarela 3

  fill(67, 100, 112, 180);
  stroke (0);
  strokeWeight(1);
  ellipse (133, 210, 55, 55); 
  //elipse azul - entre rosa e amarela 3

  stroke(0);
  strokeWeight(1);
  fill(171, 61, 45, 230);
  ellipse (180, 170, 70, 70);  
  //elipse vermelha

  fill(225, 130, 112, 180);
  stroke (0);
  strokeWeight(2);
  ellipse (130, 150, 90, 90);  
  //elipse rosa claro   

  fill(251, 173, 24, 180);
  stroke (0);
  strokeWeight(4);
  ellipse (172, 220, 39, 39);  
  //elipse amarela torrada

  fill(0);
  ellipse (172, 220, 10, 10);  
  //elipse preta dentro de amarela torrada

  fill(67, 100, 112, 180);
  stroke (0);
  strokeWeight(2);
  ellipse (110, 260, 25, 25);  
  //elipse azul - contorno amarela 3

  fill(22, 78, 159, 220);
  stroke (0);
  strokeWeight(3);
  ellipse (70, 265, 17, 17);   
  //minielipse azul escuro

  fill(171, 61, 45, 230);
  stroke (0);
  strokeWeight(2);
  ellipse (162, 300, 35, 35);  
  //elipse vermelha - contorno amarela 3

  fill(171, 61, 45, 230);
  stroke (0);
  strokeWeight(1.5);
  ellipse (200, 260, 15, 15);  
  //minielipse vermelha - contorno amarela 3 

  fill(109, 112, 165, 100);
  stroke (0);
  strokeWeight(0.5);
  ellipse (235, 105, 55, 55);  
  //elipse roxa

  fill(171, 61, 45, 230);
  stroke (0);
  strokeWeight(3);
  ellipse (170, 70, 17, 17);  
  //minielipse vermelha

  fill(171, 61, 45, 230);
  stroke (0);
  strokeWeight(6);
  ellipse (75, 226, 19, 19); 
  //minielipse vermelha - contorno mto grosso

  fill(239, 65, 35, 190);
  stroke (0);
  strokeWeight(0.5);
  ellipse (100, 320, 23, 23); 
  //elipse laranja escuro

  fill(0);
  ellipse (190, 320, 5, 5);   
  //minielipse preta mini

  fill(225, 130, 112, 180);
  stroke (0);
  strokeWeight(2);
  ellipse (315, 280, 19, 19); 
  //minielipse rosa claro

  fill(109, 112, 165, 220);
  stroke (0);
  strokeWeight(2.5);
  ellipse (220, 345, 23, 23); 
  //minielipse roxa

  fill(239, 65, 35, 190);
  stroke (0);
  strokeWeight (0.5);
  float lcb_a = map(sin(TWO_PI * t * lcb_v), -1, 1, 0, 1);
  float lcb_cx = lerp (lcb_x1, lcb_x2, lcb_a);
  float lcb_cy = lerp (lcb_y1, lcb_y2, lcb_a);
  ellipse (lcb_cx, lcb_cy, 8, 8);   
  //minielipse laranja escuro

  fill(245, 128, 32, 190);
  stroke (0);
  strokeWeight (0.5);
  ellipse (243, 310, 12, 12); 
  //minielipse laranja claro

  stroke (0);
  strokeWeight(2.5);
  line(lc_x1, lc_y1, lc_x2, lc_y2);    
  //linha centrada

  stroke (0);
  strokeWeight(1.5);
  line(100, 290, 190, 90);    
  //linha1 - elipse verm. e azul

  stroke (0);
  strokeWeight(1);
  fill(248, 210, 80, 100);
  ellipse (255, 205, 100, 100);
  //elipse amarela - cruza com azul e amarela

  stroke (0);
  strokeWeight(2);
  fill(22, 78, 159, 220);
  ellipse (300, 190, 35, 35); 
  //elipse azul escuro - contorno elipse amarela

  fill(0);
  ellipse (250, 175, 20, 20); 
  //elipse preta 3 riscos

  fill(0);
  float lc_a = map(sin(TWO_PI * t * lc_v), -1, 1, 0, 1);
  float lc_cx = lerp (lc_x1, lc_x2, lc_a);
  float lc_cy = lerp (lc_y1, lc_y2, lc_a);
  ellipse (lc_cx, lc_cy, 40, 40); 
  //minielipse preta - em cima da linha 

  stroke (0);
  strokeWeight(0.5);
  line(245, 342, 245, 100);   
  //3 linhas paralelas direita - linha 1

  stroke (0);
  strokeWeight(0.5);
  line(252, 348, 252, 90);    
  //3 linhas paralelas direita - linha 2

  stroke (0);
  strokeWeight(0.5);
  line(261, 350, 261, 70);    
  //3 linhas paralelas direita - linha 3

  stroke (0);
  strokeWeight(1);
  line(70, 140, 320, 140);    
  //linha preta deitada cruza c/ el. preta

  stroke (0);
  strokeWeight(2.5);
  line(295, 310, 280, 110);   
  //linha preta paralela às 3

  stroke (0);
  strokeWeight(0.5);
  line(80, 120, 330, 230);    
  //linha cruza a el. rosa+verme.+amarela(6)

  stroke (0);
  strokeWeight(1);
  line(160, 95, 200, 120);
  //linha(6.1)

  stroke (0);
  strokeWeight(1);
  line(165, 85, 201, 110);
  //linha(6.2)

  stroke (0);
  strokeWeight(0.5);
  line(lcb_x1, lcb_y1, lcb_x2, lcb_y2);    
  //linha que cruza linha centrada em baixo 

  stroke (0);
  strokeWeight(0.5);
  line(140, 335, 210, 130);   
  //linha diagonal que cruza el. preta maior  

  stroke (0);
  strokeWeight(0.5);
  line(150, 347, 213, 130);   
  //linha diagonal paralela à anterior

  stroke (0);
  strokeWeight(1.5);
  line(80, 250, 160, 130);    
  //linha que cruza el. rosa claro e azul

  stroke (0);
  strokeWeight(1.5);
  line(125, 335, 200, 330);  
  //linha x1

  stroke (0);
  strokeWeight(1.5);
  line(140, 320, 200, 350);  
  //linha x2

  stroke (0);
  strokeWeight(1.5);
  line(275, 150, 324, 150);  
  //linha -1

  stroke (0);
  strokeWeight(1.5);
  line(278, 157, 324, 157);  
  //linha -2

  stroke (0);
  strokeWeight(1.5);
  line(55, 239, 324, 265);   
  //linha cruza com a linha q cruza rosa e azul(9)

  stroke (0);
  strokeWeight(0.5);
  line(85, 300, 305, 270);   
  //linha cruza amarela3+minielipseverme.+amar1

  stroke (0);
  strokeWeight(0.5);
  line(50, 215, 324, 260);   
  //linha em cima da linha(9)

  stroke (0);
  strokeWeight(0.5);
  line(50, 203, 324, 250);   
  //linha paralela à anterior

  stroke (0);
  strokeWeight(0.5);
  line(270, 300, 230, 330);
  //linha /1

  stroke (0);
  strokeWeight(0.5);
  line(274, 306.5, 236, 335);
  //linha /2

  stroke (0);
  strokeWeight(0.5);
  line(276, 315.6, 241, 342);
  //linha /3

  stroke (0);
  strokeWeight(0.5);
  line(90, 235, 95, 190);
  //linha ao lado de el. vermelha contorno mto grosso

  stroke (0);
  strokeWeight(0.5);
  line(53, 230, 70, 190);
  //linha à esquerda da anterior

  stroke (0);
  strokeWeight(0.5);
  line(48, 230, 60, 190);
  //linha à esquerda da anterior

  pushMatrix();
  translate (width/1.5, (height/1.5) - 20);
  stroke (0);
  strokeWeight(2);
  fill(248, 210, 80, 100);
  ellipse (0, 0, 60, 60);
  fill(0, 0, 0);
  ellipse (30*cos(t*2), 30*sin(t*2), 15, 15); 
  //elipse amarela+elipse preta à volta
  popMatrix();
}