xxxxxxxxxx
78
let myData;
let w = 600;
let h = 600;
function preload() {
myData = loadJSON('data.json');
}
function setup() {
createCanvas(600, 600);
background(255);
setInterval(kidBackground, 500);
setInterval(myFri, 100);
setInterval(mySat, 1000);
}
function kidBackground() {
}
function myFri() {
for (let i = 0; i < myData.Fri.child.length; i++) {
if (myData.Fri.child[i] == 'hudson'){
fill(0, 0, 0);
} else if(myData.Fri.child[i] == 'rafi') {
fill(150, 150, 150);
} else if(myData.Fri.child[i] == 'both') {
fill(250,150,200)
}
textSize(myData.Sat.timeofday[i]*1.5);
text(myData.Fri.message[i], 20, h / myData.Fri.message.length * i,150,600);
}
}
function mySat() {
for (let i = 0; i < myData.Sat.message.length; i++){
if (myData.Sat.subject[i] == 'covid'){
//noStroke();
//fill(220);
//ellipse(0,h / myData.Sat.message.length + i*20,50)
} else if(myData.Sat.child[i] == 'school') {
//fill(150, 150, 150);
} else if(myData.Sat.child[i] == 'tech support') {
//fill(250,150,200)
} else if(myData.Sat.child[i] == 'playdate') {
//fill(250,150,200)
}
if (myData.Sat.child[i] == 'hudson'){
fill(0, 0, 0);
} else if(myData.Sat.child[i] == 'rafi') {
fill(150, 150, 150);
} else if(myData.Sat.child[i] == 'both') {
fill(250,150,200)
}
textSize(myData.Fri.timeofday[i]*1.5);
text(myData.Sat.message[i], 150, h / myData.Sat.message.length + i * 35,450,600);
}
}
function draw() {
}