This is my new heart that was constructed throughout class.
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
////////////////////////////////////// start below this line ˇˇˇˇˇˇˇˇˇˇ
context.beginPath();
context.rect(0, 0, canvas.width, canvas.height);
var grd = context.createLinearGradient(400, 0, 400, 600);
context.lineWidth = 7;
context.strokeStyle = 'rgb(255,102,102)';
grd.addColorStop(0, 'rgb(255,51,153)');
grd.addColorStop(.3, 'rgb(255,204,204)');
grd.addColorStop(.4, 'rgb(255,255,153)');
grd.addColorStop(.6, 'rgb(255,204,253)');
grd.addColorStop(.7, 'rgb(255,204,255)');
grd.addColorStop(1, 'rgb(204,0,204)');
context.fillStyle = grd;
context.fill();
context.stroke();
context.beginPath();
context.moveTo(400,200);
context.bezierCurveTo(300, 0, 50, 200, 250, 325);
context.quadraticCurveTo(380, 400, 400, 500);
context.lineCap= "round";
context.fillStyle = 'rgb(255,0,102)';
context.fill();
context.lineWidth = 7;
context.strokeStyle = 'rgb(255,102,102)';
context.stroke();
context.stroke();
context.beginPath();
context.moveTo(400,200)
context.bezierCurveTo(500, 0, 750, 200, 550, 325);
context.quadraticCurveTo(435, 400, 400, 500);
context.fillStyle = 'rgb(255,0,102)';
context.fill();
context.lineWidth = 7;
context.strokeStyle = 'rgb(255,102,102)';
context.stroke();
context.stroke();
////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
};
</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>
No comments:
Post a Comment