Advertisement
Guest User

canvas

a guest
Mar 26th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. var c = document.getElementById("myCanvas");
  2. var ctx = c.getContext("2d");
  3.  
  4. ctx.beginPath();
  5. ctx.arc(100, 100, 50, 0, 2 * Math.PI);
  6. ctx.fill();
  7.  
  8. ctx.beginPath();
  9. ctx.arc(100, 190, 50, 0, 2 * Math.PI);
  10. ctx.fill();
  11.  
  12. ctx.beginPath();
  13. ctx.arc(190, 100, 50, 0, 2 * Math.PI);
  14. ctx.fill();
  15.  
  16. ctx.beginPath();
  17. ctx.arc(190, 190, 50, 0, 2 * Math.PI);
  18. ctx.fill();
  19.  
  20. ctx.fillStyle = "white";
  21. ctx.beginPath();
  22. ctx.rect(50, 105, 40, 6);
  23. ctx.fill();
  24.  
  25. ctx.fillStyle = "white";
  26. ctx.beginPath();
  27. ctx.rect(210, 180, 40, 5);
  28. ctx.fill();
  29.  
  30. ctx.fillStyle = 'rgb(2, 167, 233)';
  31. ctx.beginPath();
  32. ctx.arc(100, 100, 33, 0, 2 * Math.PI);
  33. ctx.fill();
  34.  
  35. ctx.fillStyle = 'rgb(237, 22, 56)';
  36. ctx.beginPath();
  37. ctx.arc(100, 190, 33, 0, 2 * Math.PI);
  38. ctx.fill();
  39.  
  40. ctx.fillStyle = 'rgb(254, 231, 3)';
  41. ctx.beginPath();
  42. ctx.arc(190, 100, 33, 0, 2 * Math.PI);
  43. ctx.fill();
  44.  
  45. ctx.fillStyle = "white";
  46. ctx.beginPath();
  47. ctx.arc(190, 190, 33, 0, 2 * Math.PI);
  48. ctx.fill();
  49.  
  50. /*ctx.fillStyle = "black";
  51. ctx.beginPath();
  52. ctx.rect(60, 92, 55, 13);
  53. ctx.fill();*/
  54.  
  55. ctx.fillStyle = "black";
  56. ctx.beginPath();
  57. ctx.moveTo(60, 105);
  58. ctx.lineTo(105, 105);
  59. ctx.lineTo(115, 90);
  60. ctx.lineTo(60, 90);
  61. ctx.fill();
  62.  
  63. ctx.fillStyle = "black";
  64. ctx.beginPath();
  65. ctx.moveTo(83, 184);
  66. ctx.lineTo(103, 184);
  67. ctx.lineTo(150, 240);
  68. ctx.lineTo(130, 240);
  69. ctx.fill();
  70.  
  71. ctx.fillStyle = "black";
  72. ctx.beginPath();
  73. ctx.moveTo(225, 185);
  74. ctx.lineTo(190, 185);
  75. ctx.lineTo(180, 200);
  76. ctx.lineTo(225, 200);
  77. ctx.fill();
  78.  
  79. ctx.fillStyle = "black";
  80. ctx.beginPath();
  81. ctx.moveTo(140, 52);
  82. ctx.lineTo(160, 52);
  83. ctx.lineTo(200, 106);
  84. ctx.lineTo(180, 106);
  85. ctx.fill();
  86.  
  87. ctx.save();
  88. ctx.beginPath();
  89. ctx.fillStyle = "black";
  90. ctx.rotate(34 * Math.PI / 180);
  91. ctx.fillRect(180, 15, 44, 45);
  92. ctx.restore();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement