This is my abstract clock: The candles’ fire represents the passing of each second, the height of the candle represents the hour of the day and the sheets of paper represent the minutes remaining in the hour.
sketch
function setup() {
createCanvas(480, 480);
background(220);
text("p5.js vers 0.9.0 test.", 10, 15);
background (220)
}
var candle = {xPos: 130, yPos: 120, w: 50, h: 280}
var timerS;
var timerM;
var timerH;
var penX = 370;
var moveP = 0.3;
function draw() {
background(62, 35, 16); timerM = minute(); fill(76, 135, 74); rect(190, 420, 230, 20); for (var i = 0; i<=60-timerM; i++){
noStroke();
if (i%2==0){
fill(255);
} else {
fill(200);
}
rect(190, 420-(3*i), 230, 3);
}
drawPen(penX, 235+3*timerM);
penX +=moveP;
if (penX>= 380 || penX <= 350){
moveP = -moveP;
}
drawBackPanel(80, 100);
fill(154, 121, 102);
rect(0, height*9/10, width, height*9/10);
for (var i = 0; i <=12; i++){
strokeWeight(3);
stroke(161, 158, 75);
line(100, 350.4-(9.6*2*i), 215, 350.4-(9.6*2*i));
} for (var i = 0; i <=12; i++){
strokeWeight(2);
stroke(161, 158, 75);
line(120, 360-(9.6*2*i), 195, 360-(9.6*2*i));
}
drawCandleB(candle.xPos, candle.yPos, candle.w, candle.h);
drawBase(candle.xPos-10, 360);
timerH = hour();
var hourMap = map(timerH/2, 0, 12, 240, 10);
candle.yPos = 120 + 240 - hourMap;
candle.h = hourMap + 30;
}function drawCandleB (x, y, w, h){
var hourMap = map(timerH/2, 0, 12, 240, 30);
fill(250, 244, 192); noStroke()
rect(x, y, w, h); drawCandleFire(x, y, w, h);
drawCanldeT(x, y, w);
drawLight(x, y, w, h, hourMap);
}function drawCanldeT (x, y, w){
strokeWeight(8);
stroke(220, 213, 142);
line(x+2, y, x+w-2, y) line(x+w*3/5, y, x+w*3/5, y+w/2);
line(x+w*4/5, y, x+w*4/5, y+w*3/4);
}function drawCandleFire (x, y, w, h){
var fTipy;
var fTipx;
timerS = second();
if (timerS %2 == 0){
fTipy = y-w*4/5;
fTipx = x+w/2;
} else {
fTipy = y-w*4/5;
fTipx = x+w/2 - 10;
}
noStroke();
fill(246, 74, 22); ellipse(x+w/2, y-w/5, w/4, w/3);
triangle(fTipx, fTipy, x+w*5/8, y-w/5, x+3*w/8, y-w/5);
}function drawLight (x, y, w, h, hour){
timerS = second() if (timerS %2 == 0){
hourMap = hour+10;
} else {
hourMap = hour-5;
}
noStroke();
fill(249, 246, 152, 20) ellipse(x+w/2, y-w*2/5, hourMap*2, hourMap*2);
}function drawBackPanel (x, y){
strokeWeight(9);
stroke(225, 176, 104); line(x, y, x, y+350);
line(x+155, y, x+155, y+350);
arc(x+77, y, x+75, y+55, PI, 0);
noStroke();
fill(186, 167, 135);
ellipse(x+77, y, x+75, y+55);
rect(x, y, x+75, y+250);
}function drawBase (x, y){
fill(100); quad(x, y, x+70, y, x+60, y+20, x+10, y+20);
quad(x+10, 420, x+60, y+60, x+70, y+73, x, y+73);
fill(150);
rect(x+10, y+20, 50, 40);
}function drawPen (x, y){
push();
translate(x, y); rotate(radians(315)); noStroke();
fill(200); rect(0, 0, 100, 5);
fill(255); triangle(0, 0, 0, 5, -5, 2.5);
pop();
}