> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://uclaspring12.sketchpad.cc/sp/pad/view/ro.tzaq3t4qVpt/rev.4
 * 
 * authors: 
 *   Valentina
 *   Tyla

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



// This sketch builds on a prior work, "Workshop 3", created by Casey Reas
// http://uclaspring12.sketchpad.cc/sp/pad/view/ro.6Nc8CGNBHByCLg/rev.5



// Workshop 3 Template
// Clone and modify this program, then change the name to 
// [YOUR NAME] - Workshop 3
// Press Control-R to render the sketch

//Valentina Rabinovich
//workshop 2

void setup() {
  size(640,360);
  smooth();
}

void draw() {
  noStroke();
  cursor(CROSS);
    strokeCap(SQUARE);
  
//big blue quad
fill(187,228,238);
quad(-38,-153,279,62,173,387,-40,400);

//white areas
fill(255,249,247);
beginShape();
vertex(166,387);
vertex(55,319);
vertex(101,205);
vertex(235,207);
vertex(284,63);
vertex(441,145);
vertex(430,211);
vertex(640,213);
vertex(640,347);
vertex(430,211);
vertex(235,207);
endShape();

//dark grey triangle
fill(131,130,146);
triangle(164,-14,498,-14,429,137);

//black quad
fill(32,33,28);
quad(504,-24,430,204,554,204,630,-24);

//tall teal triangle
fill(53,182,191);
triangle(644,-34,555,209,654,215);

//muddy green triangle
fill(63,73,71);
triangle(373,388,424,226,669,369);

//light green quad
fill(138,138,52);
quad(188,374,240,211,417,220,364,414);

//light blue quad
fill(130,172,218);
quad(-9,205,88,212,43,313,-12,275);

//light gray quad
fill(186,184,185);
quad(-16,276,49,318,30,376,-17,368);

//gray lines
stroke(186,184,185);
//float hueVal = map(mouseX, 0, height, 0, width);
//stroke (hueVal, 184, 185);
  if (mousePressed == false) {
  strokeWeight(24);
  } else {
     float rvalue = constrain (147-mouseY, 0, 180);
     strokeWeight(rvalue+(24*(1+rvalue/8)));
//    float xvalue = constrain (mouseX, 440, 360);
//   if mouseX = xvalue;
// trying to make it so that the color changes on pressed only when the mouse is in the top quadrant
    stroke(rvalue,184,185);
  }

line(-13,279,168,381);
line(-51,205,660,215);
line(167,-4,563,214);
line(311,-20,183,365);
line(635,-18,512,368);
line(649,351,426,225);

//orange lines


stroke(242,97,44);
strokeWeight(38);
line(170,-24,37,378);
line(495,-18,367,378);
line(649,166,440,164);


//left quad
  noStroke();{
  fill(242,97,44);
//  if (mouseY > height/2){ //trying to make it so that the top corner only moves if the mouse is halfway up
    float xtop = constrain(mouseX, 170, 307);
//  }else {
//    int xtop = 170;
//  }
float xbottom = constrain(mouseX-118, 42, 185);
quad(170, 0, xtop, 0, xbottom, 360, 42, 360);
  }
  
//right quad
  noStroke();{
  fill(242,97,44);
  float xtop = constrain(mouseX, 307, 489);
  float xbottom = constrain(mouseX-118, 185, 374);
quad(489, 0, xtop, 0, xbottom, 360, 374, 360);
}

//top quad
  noStroke();{
  fill(242,97,44);
  float xleft = constrain((mouseX+460)*2, 47, 474);
  float xright = constrain(mouseX, 640, 695);
  float yleft = constrain(mouseY, 0,180);
  float yright = constrain(mouseY, 0, 180);
quad(420, 180, xleft-(5*height/(height+80)), yleft, xright, yright, 640, 180);
  }
  
//fillquad
//this one is to patch up the little hole the top quad created
  noStroke();{
    fill (242, 97, 44);
  float xleft = constrain(mouseX, 420, 474);
  float xright = constrain(mouseX, 640, 695);
  float yleft = constrain(mouseY, 0,147);
  float yright = constrain(mouseY, 0, 147);
  
  float xLEFT2 = constrain(xleft-15-(mouseY/2-70), 430, 470);
quad(420, 180, xLEFT2
, yleft, xright-100, yright, 500, 180);
    
}
}