Simple Clock Examples - with Dojo

This page has a couple examples of a quick Clock class I whipped up. This version really only uses the Dojo Toolkit for its OO class/inheritance stuff. By the time I was done here I could have probably gotten a similar result much faster by using more of the facilities it provides. But I started the first iteration without dojo, and ported afterwards.

There's a Clock, a CountdownClock and a GraphicalCountdown classes. There's lots that could be done to make them less simple:

Those are all good ideas, but then it wouldnt be simple anymore.

The first of the graphical-ish samples is showing a div with its clip property set each second. That's the default (for the time-being) for the GraphicalCountdown variation. I didnt do much with the styling/template there, you obviously could go wild.

The second one - the green clock - shows an override of the tick method to just output the seconds, and to set backgroundPosition on the main container node to provide the animation.

Plain-jane text clock [On/Off]

Plain-jane countdown to Christmas [On/Off]

Whizzier countdown to Christmas [On/Off]

Whizzier-still minute countdown [On/Off]