im in ur browser, melting ur digits

Dali Clock Javascript!

I factored out the Javascript from the Palm Pre port of Dali Clock, so now it works as a web page too, including all the display options.

If any of you browser-internals types have suggestions on how to get better performance out of the <canvas> tag (specifically in the Palm Pre version of Webkit) I'd love to hear them.

Tags: , , , , , ,

23 Responses:

  1. jered says:

    Awesome, thanks.

    The canvas is misplaced when rendered in Firefox 3.0, btw. Looks right in Safari 4.

  2. captain18 says:

    Looks like there is a way to support <canvas> for IE7/IE8 with a javascript include. Adding it in got me as far as a green canvas and this error:

    Message: 'char_width' is null or not an object
    Line: 352
    Char: 5
    Code: 0
    URI: http://www.jwz.org/xdaliclock/javascript/daliclock.js

    That's about as far as my limited abilities get me, in case anyone else is industrious enough to try and take it further.

    • scullin says:

      It's possible to plow through a few annoying IEisms to reveal that the js canvas won't sustain a framerate that is remotely interesting.

      Plus you'll never get me to submit a patch to Jamie titled "Internet Explorer Support".

  3. jwz says:

    I loaded that page into the Pre's web browser. I giggled.

  4. boggyb says:

    Cool, I can now run Dali Clock on Windows (well, in a browser on Windows but that's close enough)!

    I've spotted a couple of bugs/glitches with it:

    Glitch 1: the Orientation setting doesn't work properly. The only visible effect is that the font is larger with "Left" and "Right" than it is with "Up" and "Down" - in all cases, the numbers are not rotated. Tried with Opera 9.64 and Firefox 2.0.0.18.

    Glitch 2: with anti-aliasing off, picking "Left" or "Right" for Orientation makes the numbers go off the sides of the background.

  5. jsbowden says:

    I love that this chews up sixty percent of an entire processor core, go javascript go!

  6. lloydwood says:

    It should show the time in hexadecimal. I want to see the clock strike C:00:00.

  7. sheilagh says:

    that's so hypnotically addictive to just... watch!

  8. jakenelson says:

    that's just fantastic.

    One bug: if you set date to YMD, it shows as 09106130 (with the spacer 1s overlapping the following digit), instead of 09-06-30.