about summary refs log tree commit diff
path: root/www/scripts/test.js
blob: e9afd91e2eaabf1dd225af168984b53f0ffb426f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const canvas = document.getElementById("JSCanvas");
const ctx = canvas.getContext("2d");

function draw() {
    ctx.strokeStyle = "#" + Math.floor(Math.random() * 16777216).toString(16).padStart(6, '0')
    ctx.beginPath();
    ctx.moveTo(Math.random() * 511, Math.random() * 511);
    ctx.lineTo(Math.random() * 511, Math.random() * 511);
    ctx.stroke();
}

for (let i = 0; i < 50; i++) {
    draw()
}