[Bug 12524] It would be nice if you could see the pretty glowing lines

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12524

--- Comment #5 from Aryeh Gregor <Simetrical+w3cbug@gmail.com> 2011-05-05 22:56:30 UTC ---
Not base64-encoding it, so it's readable in the source.  base64 data URLs are
only really needed for binary formats, not HTML.  So just do something like

<a href="data:text/html,<!DOCTYPE HTML>
<html lang=en>
 <head>
  <title>Pretty Glowing Lines</title>
 </head>
 <body>
<canvas width=800 height=450></canvas>
<script>

 var context = document.getElementsByTagName('canvas')[0].getContext('2d');

 var lastX = context.canvas.width * Math.random();
 var lastY = context.canvas.height * Math.random();
 var hue = 0;
 function line() {
   context.save();
   context.translate(context.canvas.width/2, context.canvas.height/2);
   context.scale(0.9, 0.9);
   context.translate(-context.canvas.width/2, -context.canvas.height/2);
   context.beginPath();
   context.lineWidth = 5 + Math.random() * 10;
   context.moveTo(lastX, lastY);
   lastX = context.canvas.width * Math.random();
   lastY = context.canvas.height * Math.random();
   context.bezierCurveTo(context.canvas.width * Math.random(),
                         context.canvas.height * Math.random(),
                         context.canvas.width * Math.random(),
                         context.canvas.height * Math.random(),
                         lastX, lastY);

   hue = hue + 10 * Math.random();
   context.strokeStyle = 'hsl(' + hue + ', 50%, 50%)';
   context.shadowColor = 'white';
   context.shadowBlur = 10;
   context.stroke();
   context.restore();
 }
 setInterval(line, 50);

 function blank() {
   context.fillStyle = 'rgba(0,0,0,0.1)';
   context.fillRect(0, 0, context.canvas.width, context.canvas.height);
 }
 setInterval(blank, 40);

</script>
 </body>
</html>">pretty glowing lines</a>

Or is that invalid for some reason?  I don't see why it should be.  It works
fine in browsers.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 5 May 2011 22:56:45 UTC