xxxxxxxxxx
817
let radio;
let positive;
let negative;
let neither;
let accepted;
let loving;
let excited;
let interested;
let confident;
let happy;
let afraid;
let sad;
let dislike;
let alone;
let angry;
let embarrassed;
let anxious;
let sleep;
let meal;
let water;
let exercise;
let outside;
let talk;
let submit;
let email;
let button;
let posaccepted;
let posloving;
let posexcited;
let posinterested;
let posconfident;
let poshappy;
let negafraid;
let negsad;
let negdislike;
let negalone;
let negangry;
let negembarrassed;
let mehindifferent;
let mehbored;
let mehnumb;
let mehwithdrawn;
let circles = true;
let squares = true;
let triangles = true;
let current;
let size = 90;
let space = 100;
let rows = 10;
let columns = 10;
// set this to true when you're done asking questions
let questions = true;
function setup() {
createCanvas(1080, 1080);
background(255);
// frameRate(1);
strokeWeight(0);
textSize(18);
textStyle(BOLD);
//Question 1
radio = createRadio();
radio.option(1, "Good Day");
radio.option(2, "Bad Day");
radio.option(3, "Neither");
radio.style("width", "770px");
radio.position(10, 40);
//Question 2A
positive = createRadio();
positive.option(1, "Accepted/Valued");
positive.option(2, "Loving");
positive.option(3, "Excited");
positive.option(4, "Interested");
positive.option(5, "Confident");
positive.option(6, "Happy");
positive.style("width", "770px");
positive.position(10, 140);
positive.hide();
//Question 2B
negative = createRadio();
negative.option(1, "Afraid");
negative.option(2, "Sad");
negative.option(3, "Dislike");
negative.option(4, "Alone");
negative.option(5, "Angry");
negative.option(6, "Embarrassed");
negative.style("width", "770px");
negative.position(10, 140);
negative.hide();
//Question 2C
neither = createRadio();
neither.option(1, "Indifferent/Apathetic");
neither.option(2, "Bored");
neither.option(3, "Numb/Empty");
neither.option(4, "Withdrawn/Distant");
neither.style("width", "770px");
neither.position(10, 140);
neither.hide();
//Question 3A
accepted = createRadio();
accepted.option(1, "Needed/Wanted");
accepted.option(2, "Attractive");
accepted.option(3, "Loved");
accepted.option(4, "Cherished/Precious");
accepted.option(5, "Important/Esteemed");
accepted.option(6, "Popular/Admired");
accepted.option(7, "Cooperative/Helpful");
accepted.option(8, "Respected");
accepted.style("width", "700px");
accepted.position(10, 240);
accepted.hide();
//Question 3B
loving = createRadio();
loving.option(1, "Joyful");
loving.option(2, "Thankful");
loving.option(3, "Content");
loving.option(4, "Tolerant");
loving.option(5, "Caring");
loving.option(6, "Committed");
loving.option(7, "Accepting");
loving.option(8, "Humble");
loving.option(9, "Generous");
loving.style("width", "770px");
loving.position(10, 240);
loving.hide();
//Question 3C
excited = createRadio();
excited.option(1, "Amazed");
excited.option(2, "Surprised");
excited.option(3, "Energetic/Enthusiastic");
excited.option(4, "Aroused");
excited.option(5, "Moved");
excited.option(6, "Expectant");
excited.option(7, "Charged");
excited.style("width", "770px");
excited.position(10, 240);
excited.hide();
//Question 3D
interested = createRadio();
interested.option(1, "Sensitive/Responsive");
interested.option(2, "Intrigued");
interested.option(3, "Allured/Enticed");
interested.option(4, "Intimate/Romantic");
interested.option(5, "Attracted/Infatuated");
interested.option(6, "Creative/Inspired");
interested.option(7, "Curious");
interested.option(8, "Playful");
interested.style("width", "660px");
interested.position(10, 240);
interested.hide();
//Question 3E
confident = createRadio();
confident.option(1, "Trusting");
confident.option(2, "Positive");
confident.option(3, "Fearless");
confident.option(4, "Honest/Authentic");
confident.option(5, "Optimistic");
confident.option(6, "Bold/Brave");
confident.option(7, "Powerful");
confident.option(8, "Proud");
confident.style("width", "770px");
confident.position(10, 240);
confident.hide();
//Question 3F
happy = createRadio();
happy.option(1, "Joyful/Delighted");
happy.option(2, "Euphoric/Elated");
happy.option(3, "Cheerful/Playful");
happy.option(4, "Content/Satisfied");
happy.option(5, "Optimistic/Enthusiastic");
happy.option(6, "Peaceful/Tranquil");
happy.style("width", "700px");
happy.position(10, 240);
happy.hide();
//Question 3G
afraid = createRadio();
afraid.option(1, "Helpless");
afraid.option(2, "Threatened");
afraid.option(3, "Confused");
afraid.option(4, "Inferior/Insecure");
afraid.option(5, "Worried/Anxious");
afraid.option(6, "Stressed/Overwhelmed");
afraid.option(7, "Apprehensive/Nervous");
afraid.style("width", "700px");
afraid.position(10, 240);
afraid.hide();
//Question 3H
sad = createRadio();
sad.option(1, "Depressed");
sad.option(2, "Hurt");
sad.option(3, "Bereft/Inconsolable");
sad.option(4, "Melancholy/Sorrowful");
sad.option(5, "Subdued/Gloomy");
sad.option(6, "Aggrieved");
sad.option(7, "Discouraged");
sad.style("width", "800px");
sad.position(10, 240);
sad.hide();
//Question 3I
dislike = createRadio();
dislike.option(1, "Dismissive/Disdainful");
dislike.option(2, "Disgusted");
dislike.option(3, "Suspicious");
dislike.option(4, "Appalled");
dislike.option(5, "Repelled/Loathing");
dislike.option(6, "Skeptical/Disapproving");
dislike.style("width", "770px");
dislike.position(10, 240);
dislike.hide();
//Question 3J
alone = createRadio();
alone.option(1, "Distant/Withdrawn");
alone.option(2, "Lonely");
alone.option(3, "Excluded");
alone.option(4, "Fragile/Vulnerable");
alone.option(5, "Rejected/Friendless");
alone.option(6, "Desolate");
alone.style("width", "770px");
alone.position(10, 240);
alone.hide();
//Question 3K
angry = createRadio();
angry.option(1, "Offended/Insulted");
angry.option(2, "Indignant/Outraged");
angry.option(3, "Dismayed/Betrayed");
angry.option(4, "Bitter/Resentful/Jealous");
angry.option(5, "Frustrated/Annoyed");
angry.option(6, "Aggressive/Hostile");
angry.option(7, "Harassed/Persecuted");
angry.option(8, "Bored/Indifferent");
angry.option(9, "Rushed/Pressured");
angry.style("width", "770px");
angry.position(10, 240);
angry.hide();
//Question 3L
embarrassed = createRadio();
embarrassed.option(1, "Humiliated");
embarrassed.option(2, "Worthless");
embarrassed.option(3, "Guilty/Regret");
embarrassed.option(4, "Sheepish");
embarrassed.option(5, "Ashamed");
embarrassed.option(6, "Inferior");
embarrassed.style("width", "770px");
embarrassed.position(10, 240);
embarrassed.hide();
//Question 4
anxious = createSlider(0, 5, 0, 1);
anxious.position(10, 340);
anxious.style("width", "600px");
//Question 5
sleep = createSlider(0, 3, 0, 1);
sleep.position(10, 440);
sleep.style("width", "600px");
//Question 6
meal = createSlider(0, 5, 0, 1);
meal.position(10, 540);
meal.style("width", "600px");
//Question 7
water = createSlider(0, 4, 0, 1);
water.position(10, 640);
water.style("width", "600px");
//Question 8
exercise = createSlider(0, 3, 0, 1);
exercise.position(10, 740);
exercise.style("width", "600px");
//Question 9
outside = createRadio();
outside.option(1, "yes");
outside.option(2, "no");
positive.style("width", "600px");
outside.position(10, 840);
//Question 10
talk = createSlider(0, 3, 0, 1);
talk.position(10, 940);
talk.style("width", "600px");
//Email address
// email = createInput();
// email.position(10, 1040);
// button = createButton("enter");
// button.position(email.x + email.width, 1040);
//Submit button
submit = createButton("Submit");
submit.position(10, 1040);
submit.mousePressed(changeBG);
//set up color arrays
posaccepted = [
color("#df3163"),
color("#ef820c"),
color("#f9e29d"),
color("#9dc184"),
color("#9966cb"),
];
posloving = [
color("#d2203e"),
color("#fc607f"),
color("#ffe6b4"),
color("#ef820c"),
color("#ee2939"),
];
posexcited = [
color("#c6ea46"),
color("#effd5e"),
color("#fd6702"),
color("#fca3b7"),
color("#df3163"),
];
posinterested = [
color("#2aab88"),
color("#f8de7e"),
color("#faa600"),
color("#fa8073"),
color("#598baf"),
];
posconfident = [
color("#df3163"),
color("#fe6901"),
color("#ffe12a"),
color("#b5348b"),
color("#1135a7"),
];
poshappy = [
color("#fa8073"),
color("#fb812a"),
color("#ffe12a"),
color("#b068ee"),
color("#ff5bac"),
];
negafraid = [
color("#9dc184"),
color("#4f98a4"),
color("#fffdd0"),
color("#f5f5f5"),
color("#f0fff0"),
];
negsad = [
color("#4e516d"),
color("#1c2b51"),
color("#00796e"),
color("#3c3b3a"),
color("#7385a5"),
];
negdislike = [
color("#c6ea46"),
color("#4cba15"),
color("#23393a"),
color("#effd5e"),
color("#6f8238"),
];
negalone = [
color("#4e516d"),
color("#c0c0c0"),
color("#94c8da"),
color("#f9e29d"),
color("#d0f0c0"),
];
negangry = [
color("#fe6901"),
color("#c31708"),
color("#960119"),
color("#5e1913"),
color("#d4af36"),
];
negembarrassed = [
color("#fa8073"),
color("#ce5c5c"),
color("#ffe6b4"),
color("#fca3b7"),
color("#fbf0e6"),
];
mehindifferent = [
color("#f5f5f5"),
color("#c0c0c0"),
color("#d0f0c0"),
color("#7385a5"),
color("#565151"),
];
mehbored = [
color("#ffe4e1"),
color("#fdf5e6"),
color("#f4fffa"),
color("#eff8ff"),
color("#c0c0c0"),
];
mehnumb = [
color("#c0c0c0"),
color("#3c3b3a"),
color("#1c2b51"),
color("#0b0a0a"),
color("#4c5320"),
];
mehwithdrawn = [
color("#f0fff0"),
color("#c0c0c0"),
color("#7385a5"),
color("#23393a"),
color("#35272b"),
];
}
function draw() {
background(255);
if (questions == true) {
textSize(18);
textStyle(BOLD);
text("In general, how was your day today?", 10, 25);
text("How are you feeling right now?", 10, 125);
text("How anxious are you feeling today?", 10, 325);
text("Did you get enough sleep?", 10, 425);
text("Did you eat a healthy meal today?", 10, 525);
text("Did you drink water today?", 10, 625);
text("Did you move or exercise today?", 10, 725);
text("Have you been outside today?", 10, 825);
text("Have you talked or texted with family or friends today?", 10, 925);
// text("Enter your email if you would like to save your artwork to your personal gallery", 10, 1025);
textSize(12);
textStyle(NORMAL);
//Question 4 slider labels
text("Calm/Relaxed", 10, 375);
text("Focused", 115, 375);
text("Distracted/Scattered", 200, 375);
text("Tense", 355, 375);
text("Stressed", 465, 375);
text("Overwhelmed", 550, 375);
//Question 5 slider labels
text("Alert", 10, 475);
text("Well Rested", 180, 475);
text("Sleepy", 390, 475);
text("Exhausted", 555, 475);
//Question 6 slider labels
text("nothing to eat", 10, 575);
text("nothing healthy", 95, 575);
text("1 healthy thing", 215, 575);
text("1 healthy meal", 330, 575);
text("2 healthy meals", 450, 575);
text("3 healthy meals", 570, 575);
//Question 7 slider labels
text("none", 10, 675);
text("1-2 cups", 140, 675);
text("3-4 cups", 290, 675);
text("5-6 cups", 435, 675);
text("7-8+ cups", 570, 675);
//Question 8 slider labels
text("Did not move at all", 10, 775);
text("Light movement", 175, 775);
text("Moderate movement", 360, 775);
text("Exercise/worked out ", 555, 775);
//Question 10 slider labels
text("No communication", 10, 975);
text("Text/email", 190, 975);
text("Phone/video", 380, 975);
text("In person", 580, 975);
//answers to Q1
if (radio.value() == 1) {
console.log("positive/circles");
positive.show();
negative.hide();
neither.hide();
circles = true;
squares = false;
triangles = false;
} else if (radio.value() == 2) {
console.log("negative/squares");
negative.show();
positive.hide();
neither.hide();
circles = false;
squares = true;
triangles = false;
} else if (radio.value() == 3) {
console.log("neither/triangles");
neither.show();
positive.hide();
negative.hide();
circles = false;
squares = false;
triangles = true;
}
//Answers to Q2
if (positive.value() == 1) {
console.log("Accepted/Valued");
textSize(18);
textStyle(BOLD);
text(
"How would you describe your feeling of acceptance and value?",
10,
225
);
current = posaccepted;
accepted.show();
loving.hide();
excited.hide();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 2) {
console.log("Loving");
textSize(18);
textStyle(BOLD);
text("How would you describe your loving feeling?", 10, 225);
current = posloving;
accepted.hide();
loving.show();
excited.hide();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 3) {
console.log("Excited");
textSize(18);
textStyle(BOLD);
text("How would you describe your excitement?", 10, 225);
current = posexcited;
accepted.hide();
loving.hide();
excited.show();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 4) {
console.log("Interested");
textSize(18);
textStyle(BOLD);
text("How would you describe your interest?", 10, 225);
current = posinterested;
accepted.hide();
loving.hide();
excited.hide();
interested.show();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 5) {
console.log("Confident");
textSize(18);
textStyle(BOLD);
text("How would you describe your confidence?", 10, 225);
current = posconfident;
accepted.hide();
loving.hide();
excited.hide();
interested.hide();
confident.show();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (positive.value() == 6) {
console.log("Happy");
textSize(18);
textStyle(BOLD);
text("How would you describe your happiness?", 10, 225);
current = poshappy;
accepted.hide();
loving.hide();
excited.hide();
interested.hide();
confident.hide();
happy.show();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
}
if (negative.value() == 1) {
console.log("Afraid");
textSize(18);
textStyle(BOLD);
text("How would you describe your fear?", 10, 225);
current = negafraid;
afraid.show();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 2) {
console.log("Sad");
textSize(18);
textStyle(BOLD);
text("How would you describe your sadness?", 10, 225);
current = negsad;
afraid.hide();
sad.show();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 3) {
console.log("Dislike");
textSize(18);
textStyle(BOLD);
text("How would you describe your feeling of dislike?", 10, 225);
current = negdislike;
afraid.hide();
sad.hide();
dislike.show();
alone.hide();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 4) {
console.log("Alone");
textSize(18);
textStyle(BOLD);
text("How would you describe your loneliness?", 10, 225);
current = negalone;
afraid.hide();
sad.hide();
dislike.hide();
alone.show();
angry.hide();
embarrassed.hide();
} else if (negative.value() == 5) {
console.log("Angry");
textSize(18);
textStyle(BOLD);
text("How would you describe your anger?", 10, 225);
current = negangry;
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.show();
embarrassed.hide();
} else if (negative.value() == 6) {
console.log("Embarrassed");
textSize(18);
textStyle(BOLD);
text("How would you describe your embarrassment?", 10, 225);
current = negembarrassed;
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.show();
} else if (neither.value() == 1) {
console.log("Indifferent/Apathetic");
current = mehindifferent;
} else if (neither.value() == 2) {
console.log("Bored");
current = mehbored;
} else if (neither.value() == 3) {
console.log("Numb/Empty");
current = mehnumb;
} else if (neither.value() == 4) {
console.log("Withdrawn/Distant");
current = mehwithdrawn;
}
} else {
// draw all the pretty things here.
ellipseMode(CORNER);
// rows and columns
for (let x = 0; x < rows; x++) {
for (let y = 0; y < columns; y++) {
//circles
let r = floor(random(0, 5));
if (circles == true) {
fill(current[r]);
patternColors(current);
push();
translate(x * space, y * space);
circlePattern(50, 50, size);
pop();
const d = width * 0.08;
pattern(randPattern(d));
// pattern( PTN.stripe(d / int(random(6, 12))) );
// circlePattern(width/2, height/2, 500);
// //pattern(randPattern(d));
// pattern( PTN.wave(d / int(random(1, 3)), d / int(random(10, 20)), d / 5, d / 10) );
// arcPattern(100, 100, 200, 200, 0, HALF_PI, PIE);
// //pattern(randPattern(d));
// arcPattern(400, 100, 200, 200, 0, PI, PIE);
//squares
} else if (squares == true) {
fill(current[r]);
patternColors(current);
push();
translate(x * space, y * space);
squarePattern(50, 50, size);
pop();
const d = width * 0.08;
pattern(randPattern(d));
//triangles
} else if (triangles == true) {
fill(current[r]);
patternColors(current);
push();
translate(x * space, y * space);
trianglePattern(50, 50, 140, 50, 140, 140);
pop();
const d = width * 0.08;
pattern(randPattern(d));
}
}
}
}
}
function changeBG() {
radio.hide();
positive.hide();
negative.hide();
neither.hide();
accepted.hide();
loving.hide();
excited.hide();
interested.hide();
confident.hide();
happy.hide();
afraid.hide();
sad.hide();
dislike.hide();
alone.hide();
angry.hide();
embarrassed.hide();
anxious.hide();
sleep.hide();
meal.hide();
water.hide();
exercise.hide();
outside.hide();
talk.hide();
submit.hide();
// email.hide();
// button.hide();
// record that we are done asking questions
questions = false;
}
// https://openprocessing.org/sketch/1278485
function randPattern(t) {
const ptArr = [
PTN.noise(0.5),
PTN.noiseGrad(0.4),
PTN.stripe(t / int(random(6, 12))),
PTN.stripeCircle(t / int(random(6, 12))),
PTN.stripePolygon(int(random(3, 7)), int(random(6, 12))),
PTN.stripeRadial(TAU / int(random(6, 30))),
PTN.wave(t / int(random(1, 3)), t / int(random(10, 20)), t / 5, t / 10),
PTN.dot(t / 10, (t / 10) * random(0.2, 1)),
PTN.checked(t / int(random(5, 20)), t / int(random(5, 20))),
PTN.cross(t / int(random(10, 20)), t / int(random(20, 40))),
PTN.triangle(t / int(random(5, 20)), t / int(random(5, 20))),
];
return random(ptArr);
}