Created
August 23, 2012 00:04
-
-
Save paraboul/3430747 to your computer and use it in GitHub Desktop.
random cover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head></head> | |
<body> | |
<canvas id="canvas" width="800" height="600"></canvas> | |
<script> | |
var canvas = document.getElementById("canvas").getContext('2d'); | |
canvas.shadowColor="#000"; | |
canvas.shadowBlur = 10; | |
canvas.beginPath(); | |
for (var i = 0; i < 3000; i++) { | |
canvas.lineTo(Math.random() * 800, Math.random() * 600); | |
if (i%3 == 0) { | |
canvas.transform(0.995, 0, 0, 0.995, 2, 2); | |
canvas.closePath(); | |
var val = ~~(0.5+Math.random()*255); | |
canvas.fillStyle = "rgb("+val+", "+val+", "+val+")"; | |
canvas.fill(); | |
canvas.beginPath(); | |
} | |
} | |
</script> | |
</body> | |
</html> |
Cool, code looks simple yet complex.
Pretty clean ! nice job !
Huge :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try here :
http://p.nf/cover.html