CoolClock
CoolClock copied to clipboard
New fork
I needed to have this code working properly for me, so I forked it and made lots of changes to it.
The most important new features are:
- Works properly with recent versions of IE (and not at all with old ones about which I don't really care)
- Clock title
- Proper skins for digital clock and clock title
- Synchronize with web server clock
- Fixes in README.md
Have a look at it if you want.
Seems good! I'm very happy to drop that excanvas stuff. l'll take a closer look soon.
(Unrelated to this pull request), what do you think about using data attributes for the parameters (instead of the class hackery)? eg <canvas id="clockid" data-skin="swissRail" data-offset="+2" data-show-digital="true" ... etc>
or maybe
eg <canvas id="clockid" data-skin="swissRail" data-offset="+2" data-opts="digital:noSeconds" ... etc>
Yes, of course. Using attributes would be much better. Now someone needs to do it. :-)
Regarding excanvas:
I simply removed everything that mentioned excanvas, along with all IE specific code. And it works fine with IE 9+, and also with Firefox, Chromium, and Opera. Then I added an if statement at the top of findAndCreateClocks() so that old browsers such as IE 8 won't come up with a JavaScript error.
Personally, I can live with my web site not showing the clock to IE 8 users. Though maybe others can't...
I've done the attributes thing, if you would like to take a look.
+1 Is this going to get pulled in? There are a few improvements I would like to make.
Hi SeanZX85,
I'm pretty interested in this project and I'm planning to use it extensively for a site I'm building. May I ask what the improvements you are working on are?
@plp13 I would fix the attribute tagging to be HTML compliant from your branch. Also do some working on time offsets. And remove the clock styles, to trim it down. Hopefully add AMD support as well for requireJS.
However, my project will most likely be moving to a pure CSS clock. I should know more in the next few days about if I will have time to develop this.