Advertisement
BrU32

JS Canvas Rainbow Words Falling Thru The Sky SRC

Oct 25th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 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 size=prompt('Enter Size:');
  8. var outlen=(inn.length*4);
  9. var ii=4;
  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=(Number(size)+"px "+"Comic Sans");
  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,350,ii,ii++,ii++);
  26. //ctx.fill();
  27. text='';
  28. }
  29. </script>
  30. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement