xxxxxxxxxx
87
var font;
function preload() {
font = loadFont('Helvetica.ttf');
}
var words = ["Can you remember the last time your mother held you?", "How it felt so good, you didn't want it to stop?", "The sea really is our Great Mother", "She can rock you for forever", "For as long as you need", "Even if you need it until you'll die", "I went to the sea the other night, looking for you", "And as I sat under the waves", "I kept staring at the black horizon", "And I got the overwhelming sense that you had gone there", "The waves are so loud", "The black horizon", "It comes towards me","It haunts me in my dreams"];
var index = 0;
function mousePressed() {
index = index +1;
if (index == words.length){
index = 0;
}
}
var maxDiameter;
var secondmaxDiameter;
var thirdmaxDiameter;
var fourthmaxDiameter;
var fifthmaxDiameter;
var sixthmaxDiameter;
var seventhmaxDiameter;
var eightmaxDiameter;
var theta;
function setup() {
createCanvas(900, 500);
maxDiameter = 1000;
secondmaxDiameter = 700;
thirdmaxDiameter = 600;
fourthmaxDiameter = 300;
fifthmaxDiameter = 150;
sixthmaxDiameter = 90;
seventhmaxDiameter = 50;
eighthmaxDiameter = 20;
theta = 0;
}
function draw() {
background(0);
// calculate the diameter of the circle
//height/2 + sin(theta) * amplitude;
var diam = 100 + sin(theta) * maxDiameter ;
var seconddiam = 100 + sin(theta) * secondmaxDiameter;
var thirddiam = 100 + sin(theta) * thirdmaxDiameter;
var fourthdiam = 100 + sin(theta) * fourthmaxDiameter;
var fifthdiam = 100 + sin(theta) * fifthmaxDiameter;
var sixthdiam = 100 + sin(theta) * sixthmaxDiameter;
var seventhdiam = 100 + sin(theta) * seventhmaxDiameter;
var eighthdiam = 100 + sin(theta) * eighthmaxDiameter;
// draw the circles
stroke(0);
strokeWeight(0);
fill(40);
ellipse(width/2,height/2, diam, diam);
fill(35);
ellipse(width/2,height/2,seconddiam, seconddiam);
fill(30);
ellipse(width/2,height/2,thirddiam,thirddiam);
fill(25);
ellipse(width/2,height/2,fourthdiam,fourthdiam);
fill(20);
ellipse(width/2,height/2,fifthdiam, fifthdiam);
fill(15);
ellipse(width/2,height/2,sixthdiam,sixthdiam);
fill(10);
ellipse(width/2,height/2,seventhdiam,seventhdiam);
fill(2);
ellipse(width/2,height/2,eighthdiam,eighthdiam);
fill(255,255,0);
textSize(30);
textFont(font);
textAlign(CENTER,BOTTOM);
text(words[index],450,480);
theta += 0.007;
}