Skip to content

Sergiioo/accelowatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

accelowatch

A CSS automatic wristwatch that's (sort of) powered by your accelerometer

Demo

Live demo hosted on github pages.

Works best on devices with an accelerometer, as that's how you "wind" the spring.

screenshot

How does this work then?

  • Everything is drawn with CSS. There are no images, svg, canvas - it's all styled blocks.
  • When you load the page, some JavaScript sets the current date and time.
  • The hands move around the dial through CSS animation. One full circle of the second hand each minute, once per hour for the minute hand, and twice per day for the hour hand.
  • There's a MainSpring and a Rotor in watch.js. As with a regular automatic watch, movement of the watch will turn the rotor and that will wind the spring.
  • After a while, the power meter will start to power down. You need to 'wind' the watch at the point - shake your accelerometer-equipped device to put a bit more juice into the main spring.

Development

Prerequisites

Recent node, decent browser

  • Clone the repo and install the npm dependencies with:

npm install

  • Install gulp globally with:

npm install gulp --global

  • Build the application into the dist directory and run a local (browser-sync) server using:

gulp

Now you can gawp at your newly opened default browser window and marvel at the intriguing juxtaposition of the old (mechanical watch movement) with the new (shiny CSS) contained within.

About

It's a watch made from CSS and some JavaScript which you kinda sorta wind with your device's accelerometer.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published