adding blue lines

This commit is contained in:
ExtrasContainer
2024-02-04 20:47:58 +00:00
parent f39d45e22d
commit 948cd94573
+10 -1
View File
@@ -53,7 +53,7 @@ module.exports = {
ctx.fillRect(Math.random() * canvas.width, Math.random() * canvas.height, 1, 1);
}
// Adding lines
// Adding white lines
for (let i = 0; i < 30; i++) {
ctx.strokeStyle = `rgba(255,255,255,${Math.random() * 1.8})`;
ctx.beginPath();
@@ -62,6 +62,15 @@ module.exports = {
ctx.stroke();
}
// Adding blue lines
for (let i = 0; i < 30; i++) {
ctx.strokeStyle = `rgba(0, 0, 255, ${Math.random() * 0.9})`;
ctx.beginPath();
ctx.moveTo(Math.random() * canvas.width, Math.random() * canvas.height);
ctx.lineTo(Math.random() * canvas.width, Math.random() * canvas.height);
ctx.stroke();
}
// Rotation
const rotation = Math.random() * 0.2 - 0.1; // Random rotation between -0.1 and 0.1 radians
ctx.translate(canvas.width / 2, canvas.height / 2);