xxxxxxxxxx
236
var l = 2;
var r = 18;
var g = 255;
var b = 0;
var capture;
var result;
var test;
var test2;
var result2;
var test3;
var result3;
var test4;
var result4;
function setup() {
createCanvas(600, 400);
textFont("Comic Sans MS");
background(255);
strokeWeight(2);
rect(90, 55, 480, 300);
fill(0, 255, 255);
rect(30, 65, 30, 30);
fill(255, 219, 58);
rect(30, 125, 30, 30);
fill(255, 10, 238);
rect(30, 185, 30, 30);
fill(8, 255, 0);
rect(30, 245, 30, 30);
textSize(18);
text("press the up/down arrow keys to change brush size", 110, 200);
text("press r to reset", 110,240);
capture= createCapture();
capture.hide();
}
function draw() {
textSize(30);
textAlign("RIGHT");
strokeWeight(4);
stroke(0);
fill(r, g, b);
text("Art School of the World Wide Web", 50, 40);
textSize(20);
noStroke();
fill(0);
text("Grade My Work", 400, 385);
text("Portrait of the Artist", 100, 385);
//controls reset, increase and decrease in pen size
if (keyIsPressed) {
if (key == "r") {
strokeWeight(2);
fill(255);
rect(90, 55, 480, 300);
}
if (keyCode == UP_ARROW) {
l++;
}
if (keyCode == DOWN_ARROW) {
l--;
}
}
if (mouseIsPressed) {
//controls color palette
if ((mouseX > 30) & (mouseX < 60) & (mouseY > 65) & (mouseY < 95)) {
r = 0;
g = 255;
b = 255;
}
if ((mouseX > 30) & (mouseX < 60) & (mouseY > 125) & (mouseY < 155)) {
r = 255;
g = 219;
b = 58;
}
if ((mouseX > 30) & (mouseX < 60) & (mouseY > 185) & (mouseY < 215)) {
r = 255;
g = 10;
b = 238;
}
if ((mouseX > 30) & (mouseX < 60) & (mouseY > 245) & (mouseY < 275)) {
r = 8;
g = 255;
b = 0;
}
//keeps drawing in canvas, creates line
if ((mouseX > 90) & (mouseX < 570) & (mouseY > 55) & (mouseY < 355) & (pmouseX > 90) & (pmouseX < 570) & (pmouseY > 55) & (pmouseY < 355)) {
strokeWeight(l);
stroke(r, g, b);
line(pmouseX, pmouseY, mouseX, mouseY);
}
}
//portrait of the artist!
if(mouseIsPressed){
if((mouseX>100)&(mouseX<300)&(mouseY<383)&(mouseY>360)){
var aspectRatio = capture.height/capture.width;
var h= 400*aspectRatio;
image(capture,130,55,400,h);
}
}
//grade function
if (mouseIsPressed) {
if ((mouseX > 400) & (mouseX < 565) & (mouseY < 383) & (mouseY > 360)) {
fill(r, g, b);
strokeWeight(2);
rect(90, 55, 480, 300);
var test = random(6);
if (test <= 1) {
result = "omg... prodigy much??";
}
if ((test <= 2) & (test > 1)) {
result = "well, it's uh, abstract";
}
if ((test <= 3) & (test > 2)) {
result = "don't give up!";
}
if ((test > 3) & (test <= 4)) {
result = "a masterpiece"
}
if ((test > 4) & (test < 5)) {
result = "you need WAY more practice"
}
if (test > 5) {
result = "it's so evocative"
}
textSize(24);
noStroke();
fill(0);
text(result, 200, 200);
var test2 = random(8);
if (test2 <= 1) {
result2 = "A+";
}
if ((test2 <= 2) & (test2 > 1)) {
result2 = "C-";
}
if ((test2 <= 3) & (test2 > 2)) {
result2 = "C+";
}
if ((test2 > 3) & (test2 <= 4)) {
result2 = "A-"
}
if ((test2 > 4) & (test2 <= 5)) {
result2 = "F"
}
if ((test2 > 5) & (test2 <= 6)) {
result2 = "B"
}
if ((test2 > 6) & (test2 <= 7)) {
result2 = "D"
}
if (test2 > 7) {
result2 = "B+"
}
textSize(70);
stroke(255);
strokeWeight(10);
fill(r, g, b);
text(result2, 300, 300)
var test3 = random(8);
if (test3 <= 1) {
result3 = "gorgeously conceptual";
}
if ((test3 <= 2) & (test3 > 1)) {
result3 = "strong technical skill";
}
if ((test3 <= 3) & (test3 > 2)) {
result3 = "a metacritique on art";
}
if ((test3 > 3) & (test3 <= 4)) {
result3 = "very humorous"
}
if ((test3 > 4) & (test3 <= 5)) {
result3 = "nostalgic and warm"
}
if ((test3 > 5) & (test3 <= 6)) {
result3 = "terrifying. honestly scary."
}
if ((test3 > 6) & (test3 <= 7)) {
result3 = "completely new"
}
if (test3 > 7) {
result3 = "sort of boring"
}
textSize(18);
noStroke();
fill(0);
text(result3, 325, 125)
var test4 = random(8);
if (test4 <= 1) {
result4 = "bold feminist statement";
}
if ((test4 <= 2) & (test4 > 1)) {
result4 = "lacking originality";
}
if ((test4 <= 3) & (test4 > 2)) {
result4 = "derivative of pollock";
}
if ((test4 > 3) & (test4 <= 4)) {
result4 = "brought me to tears"
}
if ((test4 > 4) & (test4 <= 5)) {
result4 = "too cutesy"
}
if ((test4 > 5) & (test4 <= 6)) {
result4 = "the Met is shaking. the MoMA could never."
}
if ((test4 > 6) & (test4 <= 7)) {
result4 = "post-internet"
}
if (test4 > 7) {
result4 = "makes me hungry idk why"
}
textSize(20);
noStroke();
fill(0);
text(result4, 125, 100)
}
}
// end of draw
}