Skip to content
Merged
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
Fixed angles for hour and min
  • Loading branch information
wrongsahil committed Dec 21, 2016
commit 974722099b5267bc4e9e8cdbb179f0f4f81fffb2
4 changes: 2 additions & 2 deletions 02 - JS + CSS Clock/index-FINISHED.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@
secondHand.style.transform = `rotate(${secondsDegrees}deg)`;

const mins = now.getMinutes();
const minsDegrees = ((mins / 60) * 360) + 90;
const minsDegrees = ((mins / 60) * 360) + ((seconds/60)*6) + 90;
minsHand.style.transform = `rotate(${minsDegrees}deg)`;

const hour = now.getHours();
const hourDegrees = ((hour / 12) * 360) + 90;
const hourDegrees = ((hour / 12) * 360) + ((mins/60)*30) + 90;
hourHand.style.transform = `rotate(${hourDegrees}deg)`;
}

Expand Down