BrU32

JQ Fade/Slide In Game Final!!

Jul 10th, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <body bgcolor=ffff88>
  2. <canvas id="myCanvas" left="2240" width="2240" height="4220" style="border:0px solid #d3d3d3;">
  3. Your browser does not support the HTML5 canvas tag.</canvas>
  4. <script>
  5. var c = document.getElementById("myCanvas");
  6. var ctx = c.getContext("2d");
  7. ctx.shadowBlur = 20;
  8. ctx.fillStyle = "red";
  9. ctx.shadowColor = "blue";
  10. ctx.fillRect(20, 20, 100, 80);
  11. ctx.shadowColor = "black";
  12. setTimeout(ctx.fillRect(100, 20, 100, 80),200);
  13. setTimeout(ctx.fillRect(50, 20, 100, 80),300);
  14. </script>
  15. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
  16. <script>
  17. var scr=0;
  18. $('canvas').click(function(){
  19. var fin=Math.floor(Math.random()*108);
  20. scr=scr+1+fin;
  21. if(fin==0){
  22. alert('Game over. The final score is: '+scr+'!!');
  23. window.location="https://google.com";
  24. }
  25. });
  26. $(document).mousemove(function(){
  27. $('p').css("font-size", "20px");
  28. $('p').css("color", "red");
  29. $("document").fadeToggle('slow');
  30. $('p').fadeToggle('slow');
  31. $('p').value=('slow');
  32. $('p').css("color","red").slideUp(Math.floor(Math.random()*2000)).fadeToggle(Math.floor(Math.random()*2000));
  33. $('canvas').slideDown(Math.floor(Math.random()*2000)).fadeToggle(Math.floor(Math.random()*2000));
  34. });
  35. </script>
  36. </head>
  37. <body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment