-
Notifications
You must be signed in to change notification settings - Fork 0
/
Draw.js
47 lines (47 loc) · 1.53 KB
/
Draw.js
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
38
39
40
41
42
43
44
45
46
47
function draw() {
ctx.clearRect(0, 0, size, size);
for (i = 0; i < (num - 0.01); i++) {
for (j = i; j < (num - 0.01); j++) {
var start = ((Math.PI * 2) / (num - 0.01)) * i;
var end = ((Math.PI * 2) / (num - 0.01)) * j;
ctx.beginPath();
ctx.moveTo(
Math.sin(start*sinMult) * mult + size / 2,
Math.cos(start*cosMult) * mult + size / 2
);
ctx.lineTo(Math.sin(end*sinMult) * mult + size / 2, Math.cos(end*cosMult) * mult + size / 2);
if (colorToggleEl.checked) {
ctx.strokeStyle = `hsl(${(360 / num) * j}, 100%, 50%)`;
} else {
if (nightModeToggleEl.checked) {
ctx.strokeStyle = 'white'
} else {
ctx.strokeStyle = "black";
}
}
ctx.stroke();
}
}
points.innerHTML = j + " Points";
if (nightModeToggleEl.checked){
bodyEl.style.background = "black"
points.style.color = 'white'
reset.style.color = "white"
reset.style.border = "white 1px solid"
for (i = 0; i < labels.length; i++){
labels[i].style.color = 'white'
}
root.style.setProperty('--checkbox-main-bg', 'white')
root.style.setProperty('--checkbox-second-bg', 'black')
} else {
bodyEl.style.background = "white"
points.style.color = "black"
reset.style.color = "black"
reset.style.border = "black 1px solid"
for (i = 0; i < labels.length; i++){
labels[i].style.color = 'black'
}
root.style.setProperty('--checkbox-main-bg', 'black')
root.style.setProperty('--checkbox-second-bg', 'white')
}
}