Time

Erratica - Clock

A completely unreadable processing clock.

PFont font;

int hY = 40;

void setup (){
size (890,hY*3);
smooth ();

}

void draw (){
font = loadFont ("HelveticaNeue-12.vlw");
textFont (font);
textSize (12);
scale (.9); // use only to fit into blog header
int ms = (millis ()/100)% 200; // millis

int s = second ();
float mapS = map (s,0,60,0,127.5); //map seconds

int m = minute ();
float mapM = map (m,0,60,0,127.5); // map minutes

int h = hour ();
float mapH = map (h,0,60,0,127.5); // map hours

int d = day ();

int mo = month ();
int ye = (year ()%1000)+100;

int y = 40;
background (255);

//1 milliseconds
noStroke ();
fill (0,ms*1.2);
rect (0,y,ms,y);

stroke (0);
line (ms,y*2+5,ms,y*2+10);
fill (0);
text (ms*5, ms, y*2+25);

//2 seconds
noStroke ();
fill (0,mapS*2);
rect (200+1,y,mapS,y);

stroke (0);
line ((mapS+201),y-5,(mapS+201),y-10);
fill (0);
if (s <=9){
text (":0"+s, (mapS+201), y-15);
} else {
text (":"+s+ "''", (mapS+201), y-15);
}

//3 mins
noStroke ();
fill (0,mapM*2);
rect ((327.5+1),y,(mapM*2),y);

stroke (0);
line (((mapM*2)+328.5),y*2+5,((mapM*2)+328.5),y*2+10);
fill (0);
if (m <=9){
text (":0"+m + "'" , ((mapM*2)+328.5), y*2+25);
} else {
text (":"+m + "'" , ((mapM*2)+328.5), y*2+25);
}

//4 hour
noStroke ();
fill (0,mapH*2.65625);
rect ((582+1),y,(mapH*2),y);

stroke (0);
line (((mapH*2)+583),y-5,((mapH*2)+583),y-10);
fill (0);
text (":"+ h , ((mapH*2)+583), y-15);

//5 day
noStroke ();
fill (0,d*8.5);
rect (711,y,(d*2),y);

stroke (0);
line (((d*2)+711),y*2+5,((d*2)+711),y*2+10);

fill (0);
//text (d, ((d*2)+711), y*2+25);
if (d<=9){
text ("0"+ d, ((d*2)+711), y*2+25);
} else {
text (d, ((d*2)+711), y*2+25);
}

//6 month
noStroke ();
fill (0,mo*21.55);
rect (762,y,mo*2,y);
stroke (0);
line (((mo*2)+762),y-5,((mo*2)+762),y-10);

fill (0);
if (mo <=9){
text ("0"+mo, ((mo*2)+762), y-15);
}else {
text (mo, ((mo*2)+762), y-15);
}

//7 year
noStroke ();
fill (0);
rect (787,y,(ye),y);

stroke (0);
line (((ye)+787),y*2+5,((ye)+787),y*2+10);
text (ye+1900, ((ye+787)), y*2+25);

}

Tags:

Comments are closed.