Skip to content

Commit 9747220

Browse files
committed
Fixed angles for hour and min
1 parent fe83039 commit 9747220

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎02 - JS + CSS Clock/index-FINISHED.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@
8181
secondHand.style.transform=`rotate(${secondsDegrees}deg)`;
8282

8383
constmins=now.getMinutes();
84-
constminsDegrees=((mins/60)*360)+90;
84+
constminsDegrees=((mins/60)*360)+((seconds/60)*6)+90;
8585
minsHand.style.transform=`rotate(${minsDegrees}deg)`;
8686

8787
consthour=now.getHours();
88-
consthourDegrees=((hour/12)*360)+90;
88+
consthourDegrees=((hour/12)*360)+((mins/60)*30)+90;
8989
hourHand.style.transform=`rotate(${hourDegrees}deg)`;
9090
}
9191

0 commit comments

Comments
(0)