We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b713937 commit a2f81b4Copy full SHA for a2f81b4
Source-Code/AnalogWatch/script.js
@@ -0,0 +1,18 @@
1
+document.addEventListener('DOMContentLoaded', () => {
2
+ const hr = document.querySelector('#hr');
3
+ const mn = document.querySelector('#mn');
4
+ const sc = document.querySelector('#sc');
5
+
6
+ const deg = 6;
7
8
+ setInterval(() => {
9
+ const day = new Date();
10
+ const h = day.getHours() * 30;
11
+ const m = day.getMinutes() * deg;
12
+ const s = day.getSeconds() * deg;
13
14
+ hr.style.transform = `rotate(${h + m / 12}deg)`;
15
+ mn.style.transform = `rotate(${m}deg)`;
16
+ sc.style.transform = `rotate(${s}deg)`;
17
+ });
18
+});
0 commit comments