Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body onload="setInterval(doit,31);" bgcolor="black">
- <canvas id="myCanvas" width="1000" height="1000" style="border:1px solid #black;">
- Your browser does not support the HTML5 canvas tag.</canvas>
- <script>
- function doit(){
- var c = document.getElementById("myCanvas");
- var ctx = c.getContext("2d");
- var gradient = ctx.createLinearGradient(0, 0, Math.random()*170, 0);
- gradient.addColorStop("0", "black");
- gradient.addColorStop("0.5", "red");
- gradient.addColorStop("1.0", "black");
- ctx.fillStyle = gradient;
- ctx.lineWidth = 10;
- ctx.fillRect(0, 0, 500,250);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement