1201272-1.html 752 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <script>
  6. function draw() {
  7. var ctx = document.getElementById('c').getContext('2d');
  8. ctx.beginPath();
  9. ctx.arc(75, 75, 74, 0, 2 * Math.PI);
  10. ctx.closePath();
  11. ctx.fill();
  12. ctx.globalCompositeOperation = 'destination-out';
  13. ctx.shadowColor = 'rgba(0, 0, 0, 0.8)';
  14. ctx.shadowBlur = 3;
  15. ctx.beginPath();
  16. ctx.arc(75, 75, 40, 0, 2 * Math.PI);
  17. ctx.closePath();
  18. ctx.fill();
  19. ctx.shadowBlur = 0;
  20. ctx.globalCompositeOperation = 'source-over';
  21. ctx.lineWidth = 10;
  22. ctx.strokeStyle = 'green';
  23. ctx.beginPath();
  24. ctx.arc(75, 75, 40, 0, 2 * Math.PI);
  25. ctx.closePath();
  26. ctx.stroke();
  27. }
  28. </script>
  29. </head>
  30. <body onload='draw()' style='background: white;'>
  31. <canvas id='c' width='200' height='200'></canvas>
  32. </body>
  33. </html>