Member-only story

Javascript30 Day2 Analog Clock

YvonneDev
Aug 10, 2022

--

The Author Vasko Petrov from Codepen.

Html

Three handlers for hours, minutes, and seconds.

The diallines are the measurement on the edge of the clock.

Css

The handler positioned “absolute” with “transform-origin”.

For the “diallines”, set up different lengths for every 5 lines.

Javascript

For the static interface of diallines, rotate every 6 degrees 60 times.

run the clock() function every 1 second.

setInterval(“clock()”, 100);

--

--

YvonneDev
YvonneDev

Written by YvonneDev

❤️Front-end Web Development self-taught *share what I learned*

No responses yet