xxxxxxxxxx
133
//My color palette for randomly chosen colors
let MyColors = ["lightpink", "hotpink", "deeppink", "mediumvioletred", "palevioletred", "lavender", "thistle", "plum", "violet", "orchid", "mediumorchid", "mediumpurple", "rebeccapurple", "blueviolet", "darkviolet", "darkorchid", "darkmagenta", "purple", "indigo", "slateblue", "darkslateblue", "mediumslateblue", "white"];
//Makes sure color is random and never chosen more than once
let HeartColors = [];
for (var i = 0; i < 10; i++) {
var index = Math.floor(Math.random() * MyColors.length);
HeartColors[i] = MyColors[index];
MyColors.splice(index, 1);
}
let backgroundColor = MyColors[Math.floor(Math.random() * MyColors.length)];
//Messages
let messages = ["be mine", "xoxo", "ur cute", "love", "ur sweet", "i <3 u", "sweet pea", "love bug", "me & u", "hugs", "true love", "be true", "hot stuff"];
let message = [];
for (var i = 0; i < 1; i++) {
var index = Math.floor(Math.random() * messages.length);
message[i] = messages[index];
}
// To/froms
let tofrom = ["to emmanuel! :)", "to eujin! :)", "to fen! :)", "to katie! :)", "to laurence! :)", "to leah! :)", "to minjin! :)", "to orianna! :)", "to pat! :)", "to seyoung! :)", "to golan! :)", "to connie! :)", "to dan! :)", "to armaan! :)"];
let to = [];
for (var i = 0; i < 1; i++) {
var index = Math.floor(Math.random() * tofrom.length);
to[i] = tofrom[index];
}
//Heart!
function drawHeart() {
beginShape();
curveVertex(200, 143);
curveVertex(200, 143);
curveVertex(180, 123);
curveVertex(150, 120);
curveVertex(130, 135);
curveVertex(125, 160);
curveVertex(150, 200);
vertex(195, 245);
vertex(200, 250);
vertex(205, 245);
curveVertex(250, 200);
curveVertex(275, 160);
curveVertex(270, 135);
curveVertex(250, 120);
curveVertex(220, 123);
curveVertex(200, 143);
curveVertex(200, 143);
endShape();
}
function setup() {
createCanvas(400, 400);
background(backgroundColor);
}
function draw() {
stroke("black");
strokeWeight(1);
//Large Middle Heart
fill(HeartColors[0]);
drawHeart();
//Top Left Heart
push();
translate(7, -10);
fill(HeartColors[1]);
scale(0.3);
drawHeart();
pop();
//Bottom Left Heart
push();
translate(7, 300);
fill(HeartColors[2]);
scale(0.3);
drawHeart();
pop();
//Top Middle Heart
push();
translate(140, -10);
fill(HeartColors[3]);
scale(0.3);
drawHeart();
pop();
//Bottom Middle Heart
push();
translate(140, 300);
fill(HeartColors[4]);
scale(0.3);
drawHeart();
pop();
//Top Right Heart
push();
translate(270, -10);
fill(HeartColors[5]);
scale(0.3);
drawHeart();
pop();
//Bottom Right Heart
push();
translate(270, 300);
fill(HeartColors[6]);
scale(0.3);
drawHeart();
pop();
textAlign(CENTER);
textSize(20);
textFont("Futura");
strokeWeight(0.5);
//Message
fill(HeartColors[7]);
text(message, 200, 180);
//To:
fill(HeartColors[8]);
text(to, 120, 290);
//From: Bea
fill(HeartColors[9]);
text("from bea! <3", 280, 290);
}