interval(set_clock, 100)

canvas = doc["clock"]

# draw clock border
ctx = canvas.getContext("2d")
ctx.beginPath()
ctx.lineWidth = 10
ctx.arc(width / 2, height / 2, ray, 0, 2 * math.pi)
ctx.stroke()

for i in range(60):
    ctx.lineWidth = 1
    if i % 5 == 0:
        ctx.lineWidth = 3
    angle = i * 2 * math.pi / 60 - math.pi / 3
    x1 = width / 2 + ray * cos(angle)
    y1 = height / 2 + ray * sin(angle)
    x2 = width / 2 + ray * cos(angle) * 0.9
    y2 = height / 2 + ray * sin(angle) * 0.9
    ctx.begi