Wednesday, February 6, 2013
Heart Activity
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
////////////////////////////////////// start below this line ˇˇˇˇˇˇˇˇˇˇ
//rectangle (background)
context.beginPath();
context.rect(0, 0, 800, 600);
context.fillStyle = 'rgb(37,78,87)';
context.fill();
context.strokeStyle = 'rgb(37,78,87)';
context.stroke();
//Bezier Curve (left side)
var x = 390;
var y = 175;
var controlX1 = 285;
var controlY1 = 25;
var controlX2 = 125;
var controlY2 = 175;
var endX = 300;
var endY = 340;
//Quadratic Curve (left side)
var controlX = 350;
var controlY = 390;
var endX1 = 390;
var endY2 = 470;
//Bezier Curve (right side)
var controlX15 = 655;
var controlY15 = 185;
var controlX25 = 510;
var controlY25 = 18;
var endX5 = 390;
var endY5 = 175;
//Quadratic Curve (right side)
var controlX4 = 430;
var controlY4 = 390;
var endX4 = 470;
var endY4 = 350;
context.beginPath();
context.moveTo(x,y);
context.bezierCurveTo(controlX1, controlY1, controlX2, controlY2, endX, endY);
context.quadraticCurveTo(controlX, controlY, endX1, endY2);
context.quadraticCurveTo(controlX4, controlY4, endX4, endY4);
context.bezierCurveTo(controlX15, controlY15, controlX25, controlY25, endX5, endY5);
context.closePath();
context.lineWidth = 20;
context.lineCap = 'round';
context.strokeStyle = 'rgb(39,159,185)';
context.fillStyle = 'rgb(23,193,227)';
context.fill();
context.stroke();
////////////////////////////////////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
};
</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment