1654477.html (446B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script> 5 6 function boom() 7 { 8 const canvas = document.getElementById('canvas'); 9 const ctx = canvas.getContext('2d'); 10 11 for (let i = 0; i < 50; i++) { 12 canvas.width = 20; 13 ctx.fillStyle = 'green'; 14 ctx.fillRect(1, 1, 20, 20); 15 canvas.width = 10; 16 ctx.fillStyle = 'green'; 17 ctx.fillRect(1, 1, 10, 10); 18 } 19 } 20 21 </script> 22 </head> 23 <body onload="boom();"> 24 <canvas id="canvas"></canvas> 25 </body> 26 </html>