xxxxxxxxxx
40
let words = ["MIND", "BODY", "SOUL", "BALANCE", "SUPPORT", "REFLECT", "LUCK"];
let currentWord = ""; // variable to hold the current word
function setup() {
createCanvas(400, 400);
textFont("Times New Roman");
colorMode(HSB);
noStroke();
}
function draw() {
background("#FABAD43F");
// map the mouseX position to a hue value
let circleHue = map(mouseX, 100, width, 0, 360);
// map the mouseY position to a diameter range
let diameter = map(mouseY, 100, height, 0, 700);
// drawing the outer circle
fill(circleHue, 20, 100);
circle(width/ 2, height/ 2, diameter);
// drawing the inner circle
fill(circleHue, 10, 200); // Lighter color for inner circle
circle(width/ 2, height/ 2, diameter * 0.5);
// display of the words
fill(0);
textSize(32);
textAlign(CENTER, CENTER); // center the text
text(currentWord, width/ 2, height/ 2);
}
// change the word when the mouse is clicked
function mouseClicked() {
// pick a random word from the array
currentWord = random(words);
}