-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathengine.js
More file actions
28 lines (22 loc) · 924 Bytes
/
engine.js
File metadata and controls
28 lines (22 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const secondHand = document.querySelector(".second-container");
const minuteHand = document.querySelector(".minute-container");
const hourHand = document.querySelector(".hour-container");
setInterval(() => {
const date = new Date();
const sec = date.getSeconds();
const hr = date.getHours();
const min = date.getMinutes();
const hh = 30 * hr + min / 2;
secondHand.style.transform = "rotateZ(" + 6 * sec + "deg)";
hourHand.style.transform = "rotateZ(" + hh + "deg)";
minuteHand.style.transform = "rotateZ(" + 6 * min + "deg)";
}, 1000);
// const className = document.querySelector(".clock");
// const checkBox = document.getElementsByClassName("cbox");
// if (checkBox.checked == true) {
// className.classList.add("dark");
// } else {
// const body = document.getElementsByTagName("body");
// body[0].classList.add("bodyClass");
// className.classList.add("light");
// }