Binary Clock (JavaScript and Canvas)



Default look

<canvas width="120" height="80" id="binaryTimeCanvas"> </canvas>
<script src="http://media.plweb.se/upload/files/binary-clock.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
se.plweb.binaryClock();
// ]]>
</script>

Requirements

  1. The javascript source file
  2. a canvas tag with an id and width and height attribute in pixels, the width should be even dividable with 6 and bigger then 0 and the height should be even dividable with 4 and bigger then 0
  3. a script tag with Javascript source
  4. a script tag with Javascript source for starting the clock

Settings

on color

se.plweb.binaryClock( { color:{ on :"#FF0000" } } );

off color

se.plweb.binaryClock( { color:{ off :"#CCC" } } );

inactive color

se.plweb.binaryClock( { color:{ inactive :"#FF0000" } } );

all colors

se.plweb.binaryClock( {
color: {
on: "#FF0000",
off: "transparent",
inactive: "#CCC"
}
} );

div id

se.plweb.binaryClock( {
canvasId: "canvasId"
} );

all params

se.plweb.binaryClock( {
canvasId: "canvasId",
color: { on: "#FF0000",
off: "transparent",
inactive: "#CCC"
}
} );

One Response to Binary Clock (JavaScript and Canvas)

  1. Pingback: Denna dag | plweb.se / plweb.nu / pl1.se / pl1.nu / pl1.name

Leave a Reply

Your email address will not be published. Required fields are marked *