Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.  
  4. <body>
  5.  
  6. <canvas id="choinka" style="border: 1px solid black;">
  7. </canvas>
  8.  
  9. <script>
  10. var canvas = document.getElementById("choinka");
  11. var ctx = canvas.getContext("2d");
  12. ctx.beginPath();
  13. ctx.moveTo(85, 100);
  14. ctx.lineTo(85, 80);
  15. ctx.lineTo(60, 80);
  16. ctx.lineTo(90, 35);
  17. ctx.lineTo(120, 80);
  18. ctx.lineTo(95, 80);
  19. ctx.lineTo(95, 100);
  20.  
  21. ctx.fill();
  22. ctx.strokeStyle = "green";
  23. ctx.stroke();
  24.  
  25. ctx.fillStyle = "red";
  26. ctx.fill();
  27.  
  28. ctx.beginPath();
  29. ctx.moveTo(85, 100);
  30. ctx.lineTo(85, 40);
  31. ctx.lineTo(60, 40);
  32. ctx.lineTo(90, 15);
  33. ctx.lineTo(120, 40);
  34. ctx.lineTo(95, 40);
  35. ctx.lineTo(95, 50);
  36.  
  37. ctx.fill();
  38. ctx.strokeStyle = "green";
  39. ctx.stroke();
  40.  
  41. ctx.fillStyle = "red";
  42. ctx.fill();
  43. </script>
  44.  
  45. </body>
  46.  
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement