Coolock

A cool clock with pure JavaScript and HTML5 (GitHub Repo).

Coolock

Create a div element which has an id attribute like so:

<div id="coolockWrapper"></div>

Then place the code below after the div:

new Coolock(options);

where options is an object containing these properties:

Property Type Description Default Value
size Number The size of canvas. 400
strokeColor String The html color of strokes like red and #f00. #000
fillColor String The filling color like blue and #00f #fff
lineCap String The type of line cap could be butt, round or square. round
canvasId String The id of canvas. coolock
canvasWrapperId String The id of html element that Coolock canvas should be rendered there. coolockWrapper
var myCoolock = new Coolock({size: 50});

var anotherCoolock = new Coolock({size: 150, canvasId: 'anotherCoolock', strokeColor: '#00a'});

var o = {size: 100, lineCap: 'butt', canvasId: 'anotherCoolock', fillColor: 'black', strokeColor: '#fff'};
new Coolock(o);

Farahmand Moslemi

GNU GPL2