Advertisement
cvbzdcvvb

Untitled

Jan 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.50 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,140,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,180,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,220,15,0,2*Math.PI);
  131. ctx.fillStyle = 'white'
  132. ctx.fill();
  133. ctx.stroke();
  134. }
  135. }
  136. for (var i=0;i<=7;i++)
  137. {
  138. if (i%2!=0)
  139. {
  140. ctx.beginPath();
  141. ctx.arc((i * 40) + 20,260,15,0,2*Math.PI);
  142. ctx.fillStyle = 'white'
  143. ctx.fill();
  144. ctx.stroke();
  145. }
  146. }
  147. for (var i=0;i<=7;i++)
  148. {
  149. if (i%2==0)
  150. {
  151. ctx.beginPath();
  152. ctx.arc((i * 40) + 20,300,15,0,2*Math.PI);
  153. ctx.fillStyle = 'white'
  154. ctx.fill();
  155. ctx.stroke();
  156. }
  157. }
  158. for (var i=0;i<=7;i++)
  159. {
  160. if (i%2!=0)
  161. {
  162. ctx.beginPath();
  163. ctx.arc((i * 40) + 20,100,15,0,2*Math.PI);
  164. ctx.fillStyle = 'white'
  165. ctx.fill();
  166. ctx.stroke();
  167. }
  168. }
  169. for (var i=0;i<=7;i++)
  170. {
  171. if (i%2!=0)
  172. {
  173. ctx.beginPath();
  174. ctx.arc((i * 40) + 20,20,15,0,2*Math.PI);
  175. ctx.fillStyle = 'white'
  176. ctx.fill();
  177. ctx.stroke();
  178. }
  179. }
  180. for (var i=0;i<=7;i++)
  181. {
  182. if (i%2==0)
  183. {
  184. ctx.beginPath();
  185. ctx.arc((i * 40) + 20,60,15,0,2*Math.PI);
  186. ctx.fillStyle = 'white'
  187. ctx.fill();
  188. ctx.stroke();
  189. }
  190. }
  191. for (var i=0;i<=7;i++)
  192. {
  193. if (i%2!=0)
  194. {
  195. ctx.beginPath();
  196. ctx.arc((i * 40) + 20,140,15,0,2*Math.PI);
  197. ctx.fillStyle = '#FF4500'
  198. ctx.fill();
  199. ctx.stroke();
  200. }
  201. }
  202. for (var i=0;i<=7;i++)
  203. {
  204. if (i%2==0)
  205. {
  206. ctx.beginPath();
  207. ctx.arc((i * 40) + 20,180,15,0,2*Math.PI);
  208. ctx.fillStyle = '#FF4500'
  209. ctx.fill();
  210. ctx.stroke();
  211. }
  212. }
  213. for (var i=0;i<=7;i++)
  214. {
  215. if (i%2!=0)
  216. {
  217. ctx.beginPath();
  218. ctx.arc((i * 40) + 20,220,15,0,2*Math.PI);
  219. ctx.fillStyle = '#FF4500'
  220. ctx.fill();
  221. ctx.stroke();
  222. }
  223. }
  224. for (var i=0;i<=7;i++)
  225. {
  226. if (i%2==0)
  227. {
  228. ctx.beginPath();
  229. ctx.arc((i * 40) + 20,260,15,0,2*Math.PI);
  230. ctx.fillStyle = '#FF4500'
  231. ctx.fill();
  232. ctx.stroke();
  233. }
  234. }
  235. for (var i=0;i<=7;i++)
  236. {
  237. if (i%2!=0)
  238. {
  239. ctx.beginPath();
  240. ctx.arc((i * 40) + 20,300,15,0,2*Math.PI);
  241. ctx.fillStyle = '#FF4500'
  242. ctx.fill();
  243. ctx.stroke();
  244. }
  245. }
  246. for (var i=0;i<=7;i++)
  247. {
  248. if (i%2==0)
  249. {
  250. ctx.beginPath();
  251. ctx.arc((i * 40) + 20,100,15,0,2*Math.PI);
  252. ctx.fillStyle = '#FF4500'
  253. ctx.fill();
  254. ctx.stroke();
  255. }
  256. }
  257. for (var i=0;i<=7;i++)
  258. {
  259. if (i%2==0)
  260. {
  261. ctx.beginPath();
  262. ctx.arc((i * 40) + 20,20,15,0,2*Math.PI);
  263. ctx.fillStyle = '#FF4500'
  264. ctx.fill();
  265. ctx.stroke();
  266. }
  267. }
  268. for (var i=0;i<=7;i++)
  269. {
  270. if (i%2!=0)
  271. {
  272. ctx.beginPath();
  273. ctx.arc((i * 40) + 20,60,15,0,2*Math.PI);
  274. ctx.fillStyle = '#FF4500'
  275. ctx.fill();
  276. ctx.stroke();
  277. }
  278. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement