As timepiece creations gain popularity, coders are mastering its complexities

As timepiece creations gain popularity, coders are mastering its complexities

A wristwatch appeared on Codepen and everyone who saw it was pretty much amazed. Created by "Sindre," the brown wristband and white timepiece with gray hands that clip along with metronome efficiency is set against a light blue background. Easy to read, pleasing to the eye and full of interesting code, the design is being shared widely.

The timepiece is created with CSS, HTML and JavaScript, with CSS doing the heavy lifting and making use of features in unique ways. CSS is used to create the watch's hands while JavaScript keeps track of the time. The code is elegant and functional. HTML builds the background and the snippet's non-moving elements. There is no sound or cheesy background noise.

Though some users might be concerned that the watch won't track time when a tab isn't in active use, the watch is updated once the tab is active. If you are watching the clock, it will move. If you aren't watching the clock then it doesn't really matter.

Already, the pen has a page and a half worth of forks. Other users have created similar pieces but with different dimensions and colors. Some straps are shorter, while watch faces are larger. Some hands are red. One community member removed the straps and watch elements entirely, choosing to focus on the nifty CSS and JavaScript integration and stripping back HTML. Timepiece is proving to be quite popular with front-end developers of all stripes who are working out their own interpretations.

Most adaptations take away from the original by removing various watch elements. No forks have created a version with actual numbers on the watch's face. Though this might detract from the watch's minimalist style, it would be interesting to see if any enterprising coders figure out a way to incorporate numerical values onto the watch's face.

CSS HTML Javascript