March - HTML5 Canvas Clock Script

March is a Javascript script file which will draw and animate analogue clocks on HTML5 canvas elements. Getting away from my usual naming convention, I have called it "March" instead of "ClockCanvas" or "WatchCanvas" - there is no prize for figuring out why. As with TagCanvas and Glowspot, I'm releasing it under the LGPL v3 license. Here are two example clocks using the script:

Standard clock, no options set

Background image, no dial, image-based hands

The clock on the left is using the default options. The clock on the right uses a background image instead of a drawn dial, and the hands are drawn using PNG images. The right-hand clock should also be showing UTC (or GMT if you prefer) instead of your local time.

Note: the canvas element is not supported by Internet Explorer versions up to and including version 8. I have made no attempt to get March working with ExplorerCanvas, though some parts of it do. Image-based hands certainly will not work. IE9 supports canvas scripts without any problems.

Instructions

1. Download the javascript file from here: march.js version 1.0 (6.1k) or minified version (4.0k)

The minified version has been compressed using the Yahoo! YUI Compressor.

2. Include the file into your page: