var dernierX = canv57.width * Math.random();
var dernierY = canv57.height * Math.random();
var hue = 0; // couleur
function animate() {
context57.save();
context57.lineCap = "round";
context57.beginPath();
context57.lineWidth = 5 + Math.random() *
10;
context57.moveTo(dernierX, dernierY);
dernierX = canv57.width * Math.random();
// prochain point
dernierY = canv57.height * Math.random();
context57.bezierCurveTo(canv57.width * Math.random(), canv57.height * Math.random(),
canv57.width * Math.random(), canv57.height * Math.random(), dernierX, dernierY);
hue = hue + 10 * Math.random();
// modification de la couleur
context57.strokeStyle = "hsl("+ hue +",50%,50%)";
context57.shadowColor = "white";
context57.shadowBlur = 10;
context57.stroke();
context57.restore();
}
function assombrir() {
context57.fillStyle = "rgba(0,0,0,0.1)";
context57.fillRect(0, 0,
canv57.width, canv57.height);
}
setInterval(animate, 100);
setInterval(assombrir, 40);
</script> |
|