Spaces:
Sleeping
Sleeping
Commit
·
8dd2299
1
Parent(s):
55cdcd7
bug fix
Browse files- index.html +5 -8
index.html
CHANGED
|
@@ -14,7 +14,6 @@
|
|
| 14 |
display: flex;
|
| 15 |
justify-content: center;
|
| 16 |
align-items: center;
|
| 17 |
-
background-color: lightblue;
|
| 18 |
}
|
| 19 |
|
| 20 |
#canvas-container {
|
|
@@ -26,7 +25,6 @@
|
|
| 26 |
#drawing-canvas {
|
| 27 |
width: 100%;
|
| 28 |
height: 100%;
|
| 29 |
-
background-color: lightblue;
|
| 30 |
}
|
| 31 |
|
| 32 |
#text-container {
|
|
@@ -66,9 +64,7 @@
|
|
| 66 |
resizeCanvas();
|
| 67 |
|
| 68 |
function resetTimer() {
|
| 69 |
-
|
| 70 |
-
clearTimeout(timer);
|
| 71 |
-
}
|
| 72 |
timer = setTimeout(decideWinner, 5000);
|
| 73 |
}
|
| 74 |
|
|
@@ -84,13 +80,14 @@
|
|
| 84 |
}
|
| 85 |
|
| 86 |
function draw() {
|
| 87 |
-
// Clear the canvas
|
| 88 |
-
ctx.
|
|
|
|
| 89 |
|
| 90 |
// Draw all circles
|
| 91 |
circles.forEach(circle => {
|
| 92 |
ctx.beginPath();
|
| 93 |
-
ctx.arc(circle.x, circle.y, 50, 0,
|
| 94 |
ctx.fillStyle = circle.color || 'white';
|
| 95 |
ctx.fill();
|
| 96 |
ctx.closePath();
|
|
|
|
| 14 |
display: flex;
|
| 15 |
justify-content: center;
|
| 16 |
align-items: center;
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
#canvas-container {
|
|
|
|
| 25 |
#drawing-canvas {
|
| 26 |
width: 100%;
|
| 27 |
height: 100%;
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
#text-container {
|
|
|
|
| 64 |
resizeCanvas();
|
| 65 |
|
| 66 |
function resetTimer() {
|
| 67 |
+
clearTimeout(timer);
|
|
|
|
|
|
|
| 68 |
timer = setTimeout(decideWinner, 5000);
|
| 69 |
}
|
| 70 |
|
|
|
|
| 80 |
}
|
| 81 |
|
| 82 |
function draw() {
|
| 83 |
+
// Clear the canvas and fill with background color
|
| 84 |
+
ctx.fillStyle = 'lightblue';
|
| 85 |
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
| 86 |
|
| 87 |
// Draw all circles
|
| 88 |
circles.forEach(circle => {
|
| 89 |
ctx.beginPath();
|
| 90 |
+
ctx.arc(circle.x, circle.y, 50, 0, Math.PI * 2); // Radius of 50
|
| 91 |
ctx.fillStyle = circle.color || 'white';
|
| 92 |
ctx.fill();
|
| 93 |
ctx.closePath();
|