xxxxxxxxxx
var strokew = 0;
function setup()
{
createCanvas(windowWidth, windowHeight);
background(255);
}
function draw()
{
translate(windowWidth / 2, (windowHeight / 2) - (windowHeight / 20));
background(255);
var radius = windowHeight / 3;
var numPoints = 60;
var angle = TWO_PI / numPoints;
var minutesRadius = radius * 0.5;
var hoursRadius = radius * 0.5;
var clockDiameter = radius * 1.0;
var m = map(minute() + norm(second(), 0, 60), 0, 60, 0, TWO_PI) - HALF_PI;
var h = map(hour() + norm(minute(), 0, 60), 0, 24, 0, TWO_PI * 2) - HALF_PI;
fill(255);
stroke(0);
ellipse(0, 0, clockDiameter, clockDiameter);
stroke(0);
strokew = map(windowHeight, 0, displayHeight, 1, 20);
strokeWeight(strokew);
line(0, 0, cos(m) * minutesRadius, sin(m) * minutesRadius);
line(0, 0, cos(h) * hoursRadius, sin(h) * hoursRadius);
line(0, 0 - clockDiameter / 2, 0, 0 + clockDiameter / 2);
fill(0);
noStroke();
textSize(35);
textFont("Roboto");
textAlign(CENTER, TOP);
//text('PEACE', 0, (clockDiameter / 2) + 50);
}