Chapter 3: Building Douglas

From Chapter 3 of Writing Computer Code by Chris Minnick and Eva Holland.

by Geppone

CSS

function canvasJob() {
  var canvas = document.getElementById("tela");
  var context = nul; 
  
  if (modernizr.canvas) { 
    context = canvas.getContext("2d");
    
    context.fillStyle = "rgb(18,83,38)";
    context.fillRect(30,30,100,100);
    context.fillstyle = "rgb(30,70,23)";
    context.strokeRec(29,29,102,102);
    
    context.beginPath();
    context.moveTo(60,60);
    context.lineTo(100,120);
    context.moveTo(100,120);
    context.lineTo(120,20);
    
    context.lineWidth = 15;
    context.lineCap = "round";
    context.strokeStyle = "rgba(32,345,64,0.5)";
    context.stroke();
   }
  }
  </script>