-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
37 lines (33 loc) · 955 Bytes
/
script.js
File metadata and controls
37 lines (33 loc) · 955 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
29
30
31
32
33
34
35
36
37
let rotated = document.querySelectorAll("#buttonRotate");
rotated.forEach((item) => {
let isRotate = false,
count = 1;
console.log("here");
item.parentNode.addEventListener("click", () => {
console.log(isRotate);
console.log(count);
if (isRotate && count == 2) {
item.style.transform = `rotate(${0}deg)`;
isRotate = false;
count = 1;
} else {
rotated.forEach((itemNode) => {
// console.log(item !== itemNode);
if (item != itemNode) {
itemNode.style.transform = `rotate(${0}deg)`;
isRotate = false;
count = 1;
}
});
item.style.transform = `rotate(${180}deg)`;
isRotate = true;
}
count++;
});
});
// /////////////////////////////////////////////////////////////
// Clip Board
let copyButton = document.querySelectorAll("#copy-button");
copyButton.forEach(
item => (item.onclick = () => alert("Have been Finished "))
);