Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. var elem=document.getElementById("myCanvas");
  2. var ctx=elem.getContext("2d");
  3. ctx.fillStyle = '#2E64FE';
  4. ctx.strokeStyle = '#0B0B61';
  5. ctx.lineWidth = 0.5;
  6. for (var i=0;i<=7;i++)
  7. {
  8. if (i%2==0)
  9. {
  10. ctx.fillStyle = 'white';
  11. } else
  12. {
  13. ctx.fillStyle = '#FF4500';
  14. }
  15. ctx.fillRect(i*40,0,40,40);
  16. ctx.strokeRect(i*40,0,40,40);
  17. }
  18. for (var i=0;i<=7;i++)
  19. {
  20. if (i%2==0)
  21. {
  22. ctx.fillStyle = '#FF4500';
  23. } else
  24. {
  25. ctx.fillStyle = 'white';
  26. }
  27. ctx.fillRect(i*40,40,40,40);
  28. ctx.strokeRect(i*40,40,40,40);
  29. }
  30. for (var i=0;i<=7;i++)
  31. {
  32. if (i%2==0)
  33. {
  34. ctx.fillStyle = 'white';
  35. } else
  36. {
  37. ctx.fillStyle = '#FF4500';
  38. }
  39. ctx.fillRect(i*40,80,40,40);
  40. ctx.strokeRect(i*40,80,40,40);
  41. }
  42. for (var i=0;i<=7;i++)
  43. {
  44. if (i%2==0)
  45. {
  46. ctx.fillStyle = '#FF4500';
  47. } else
  48. {
  49. ctx.fillStyle = 'white';
  50. }
  51. ctx.fillRect(i*40,120,40,40);
  52. ctx.strokeRect(i*40,120,40,40);
  53. }
  54. for (var i=0;i<=7;i++)
  55. {
  56. if (i%2==0)
  57. {
  58. ctx.fillStyle = 'white';
  59. } else
  60. {
  61. ctx.fillStyle = '#FF4500';
  62. }
  63. ctx.fillRect(i*40,160,40,40);
  64. ctx.strokeRect(i*40,160,40,40);
  65. }
  66. for (var i=0;i<=7;i++)
  67. {
  68. if (i%2==0)
  69. {
  70. ctx.fillStyle = '#FF4500';
  71. } else
  72. {
  73. ctx.fillStyle = 'white';
  74. }
  75. ctx.fillRect(i*40,200, 40,40);
  76. ctx.strokeRect(i*40,200,40,40);
  77. }
  78. for (var i=0;i<=7;i++)
  79. {
  80. if (i%2==0)
  81. {
  82. ctx.fillStyle = 'white';
  83. } else
  84. {
  85. ctx.fillStyle = '#FF4500';
  86. }
  87. ctx.fillRect(i*40,240,40,40);
  88. ctx.strokeRect(i*40,240,40,40);
  89. }
  90. for (var i=0;i<=7;i++)
  91. {
  92. if (i%2==0)
  93. {
  94. ctx.fillStyle = '#FF4500';
  95. } else
  96. {
  97. ctx.fillStyle = 'white';
  98. }
  99. ctx.fillRect(i*40,280,40,40);
  100. ctx.strokeRect(i*40,280,40,40);
  101. }
  102.  
  103. for (var i=0;i<=7;i++)
  104. {
  105. if (i%2!=0)
  106. {
  107. ctx.beginPath();
  108. ctx.arc((i * 40) + 20,20,15,0,2*Math.PI);
  109. ctx.fillStyle = 'white'
  110. ctx.fill();
  111. ctx.stroke();
  112. }
  113. }
  114. for (var i=0;i<=7;i++)
  115. {
  116. if (i%2==0)
  117. {
  118. ctx.beginPath();
  119. ctx.arc((i * 40) + 20,60,15,0,2*Math.PI);
  120. ctx.fillStyle = 'white'
  121. ctx.fill();
  122. ctx.stroke();
  123. }
  124. }
  125. for (var i=0;i<=7;i++)
  126. {
  127. if (i%2!=0)
  128. {
  129. ctx.beginPath();
  130. ctx.arc((i * 40) + 20,100,15,0,2*Math.PI);
  131. ctx.fillStyle = 'white'
  132. ctx.fill();
  133. ctx.stroke();
  134. }
  135. }
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153. for (var i=0;i<=7;i++)
  154. {
  155. if (i%2==0)
  156. {
  157. ctx.beginPath();
  158. ctx.arc((i * 40) + 20,220,15,0,2*Math.PI);
  159. ctx.fillStyle = '#8B0000'
  160. ctx.fill();
  161. ctx.stroke();
  162. }
  163. }
  164. for (var i=0;i<=7;i++)
  165. {
  166. if (i%2!=0)
  167. {
  168. ctx.beginPath();
  169. ctx.arc((i * 40) + 20,260,15,0,2*Math.PI);
  170. ctx.fillStyle = '#8B0000'
  171. ctx.fill();
  172. ctx.stroke();
  173. }
  174. }
  175. for (var i=0;i<=7;i++)
  176. {
  177. if (i%2==0)
  178. {
  179. ctx.beginPath();
  180. ctx.arc((i * 40) + 20,300,15,0,2*Math.PI);
  181. ctx.fillStyle = '#8B0000'
  182. ctx.fill();
  183. ctx.stroke();
  184. }
  185. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement