BrU32

JS Canvas Random Flashing Rainbow Text SRC

Sep 2nd, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <html>
  2. <body onload="setInterval(drawe,22)" background-color="white">
  3. <canvas id="myCanvas" width="1000" height="1000" style="background:black;">
  4. </canvas>
  5. <script>
  6. var inn=prompt('Enter String:');
  7. var outlen=(inn.length*4);
  8. var ii=outlen;
  9.  
  10. function drawe(){
  11. var out
  12. ii++;
  13. var text = "";
  14. var possible = "FABCGDE0123456789";
  15. var canvas = document.getElementById("myCanvas");
  16. var ctx = canvas.getContext("2d");
  17. ctx.font="50px Comis Ariel"
  18. for(var i=0; i!=6; i++)
  19. text+=possible.charAt(Math.floor(Math.random()*possible.length));
  20. ctx.strokeStyle='#'+text;
  21. ctx.fillStyle="#"+text;
  22. var c = document.getElementById("myCanvas");
  23. var ctx = c.getContext("2d");
  24. ctx.beginPath();
  25. ctx.fillText(inn,300,350,ii,ii,ii);
  26. ctx.fill();
  27. text='';
  28. if(outlen<4){
  29.  
  30. }
  31. }
  32. </script>
  33. </body>
Advertisement
Add Comment
Please, Sign In to add comment