Fly with code

Get wet inside ocean of code

0%

JS30 02 - JS and CSS Clock

Process Flow

HTML

  • Set up the DOM structure of the clock

CSS

  • Set up clock face as an square
  • Draw out center of clock face
  • Set up original position of each hand at 12AM direction

JavaScript

  • Do the math, count how many degrees each hand moves when time passes by
  • Use setInterval() to update position of each hand every second