katieche-project-06

katieche-06

/*
katie chen
section e
project 06
katieche@andrew.cmu.edu
*/

function setup() {
    createCanvas(300, 300);
}

function draw() {
	var h = hour();
	var m = minute();
	var s = second();
	angleMode(DEGREES);

	// make it 12 hours!
	if (h > 11) {
		h = h - 12;
	}

	else {
		h=h;
	}

	background (196, 220, 255);
	textAlign(CENTER);
	text(h+":"+m+":"+s, width/2, 40);

	noStroke();

	// minute / rabbit rising
	push();
	fill (250);
	ellipse (150, 370-m, 100, 170);
	ellipse (125, 290-m, 20, 90);
	ellipse (175, 290-m, 20, 90);
	fill (250, 210, 196);
	ellipse (120, 325-m, 10, 10);
	ellipse (180, 325-m, 10, 10);
	fill (0);
	ellipse (125, 320-m, 7, 7);
	ellipse (175, 320-m, 7, 7);
	pop();

	//hour / sun
	push();
	fill (255, 235, 127);
	ellipse (260*h/11, 100, 40, 40);
	noFill();
	stroke(255, 236, 170);
	strokeWeight (2);
	ellipse (260*h/11, 100, 55, 55);


	pop();
	//seconds / clouds 
	push();
	fill (250);
	ellipse(300*s/59, 100, 30, 30);
	ellipse(300*s/59, 105, 50, 20);
	ellipse(370*s/59, 140, 40, 30);
	ellipse(380*s/59, 145, 80, 20);
	ellipse(220*s/59, 125, 60, 20);
	ellipse(210*s/59, 120, 40, 20);
	ellipse(260*s/59, 140, 40, 10);
	pop();


}

I wanted to do something completely different from the traditional rotating clock. I tried to create more of a story, where the sun and clouds move horizontally like in real life and the rabbit rises and sinks.

Leave a Reply