// canvas definition standard variables canvas = document.getElementById('canvasArea'); context=canvas.getContext("2d"); // a2. layout of first rectangle var x1Pos = 25; var x2Pos = 125; var x3Pos = 225; var yPos = 10; var length = 100; var height = 25; // a3. rectangle with shadow context.shadowOffsetX = 4; context.shadowOffsetY = 4; context.shadowBlur = 3; context.fillStyle = "deeppink"; context.shadowColor = "gray"; context.fillRect(x1Pos, yPos,length,height); // a4. rectange with shadow context.shadowOffsetX = 8; context.shadowOffsetY = 8; context.shadowBlur = 3; context.strokeStyle = "aqua"; context.shadowColor = "lightgreen"; context.lineWidth = 9; context.strokeRect(x2Pos,yPos,length,height); // a5. rectangle with shadow context.shadowOffsetX = 30; context.shadowOffsetY = 30; context.shadowBlur = 9; context.fillStyle = "darkorange"; context.shadowColor = "greenyellow"; context.fillRect(x3Pos,yPos,length,height);