Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.html #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions exercises/02 - JS + CSS Clock/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
setInterval(() => {

// Create new Date object
const now = new Date();
const clockHand = new Date();

// Get current seconds, minutes, & hours and calculate the degree shift
const
secondHandDegrees = calcDegrees(now.getSeconds(), 60),
minuteHandDegrees = calcDegrees(now.getMinutes(), 60),
hourHandDegrees = calcDegrees(now.getHours(), 12);
secondHandDegrees = calcDegrees(clockHand.getSeconds(), 60),
minuteHandDegrees = calcDegrees(clockHand.getMinutes(), 60),
hourHandDegrees = calcDegrees(clockHand.getHours(), 12);

// Apply rotation to the clock hands corresponding with current time value
secondHand.style.transform = `rotate(${secondHandDegrees}deg)`;
Expand Down