Sunday, September 8, 2013

Heart HTML



<!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.moveTo(300, 200);
context.bezierCurveTo(300, 200, 150, 50, 150, 250);
context.bezierCurveTo(150, 250, 175, 400, 300, 500);
context.bezierCurveTo(300, 500, 400, 425, 450, 250);
context.bezierCurveTo(450, 250, 450, 50, 300, 200);

context.closePath();
context.lineWidth = 10;
context.fillStyle = 'rgb(255, 0, 0)';
context.fill();
context.strokeStyle = 'pink';
context.stroke();






////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ

};

</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>

No comments:

Post a Comment