<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
#myCanvas {
border: 1px solid #9C9898;
}
</style>
<script>
window.onload = function() {
var canvas = document.getElementById(" myCanvas");
var context = canvas.getContext("2d");
////////////////////////////// ////////sky//////////
var x = 0;
var y = 0;
var width = 800;
var height = 800;
context.beginPath();
context.rect(x,y,width,height) ;
context.fillStyle = '#99FFFF';
context.fill();
context.lineWidth = 5;
context.strokeStyle = '#99FFFF';
context.stroke()
////////////////////////////// //////// end above this line ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
////////////////////////////// ///////////////////////sun//// /////////
var centerX = canvas.width / 6;
var centerY = canvas.height / 7;
var radius = 80;
var startangle = 0;
var endangle = 2 * Math.PI;
context.beginPath();
context.arc(centerX, centerY, radius, startangle, endangle, false);
// context.fillStyle = "green";
var grd=context. createRadialGradient(centerX, centerY, 10, centerX, centerY, 50);
grd.addColorStop(0, "#FFFF99");
grd.addColorStop(1, "#FFFF33");
context.fillStyle = grd;
context.fill();
context.lineWidth = 5;
context.strokeStyle = "FFFF33";
context.stroke();
////////////////////////////// ////////////////////////////
////////////////////////////// ///////////////////////face/// //////////
var centerX = canvas.width / 1.5;
var centerY = canvas.height / 2;
var radius = 60;
var startangle = 0;
var endangle = 2 * Math.PI;
context.beginPath();
context.arc(centerX, centerY, radius, startangle, endangle, false);
// context.fillStyle = "green";
var grd=context. createRadialGradient(centerX, centerY, 10, centerX, centerY, 50);
grd.addColorStop(0, "#FFCC99");
grd.addColorStop(1, "#FFCC99");
context.fillStyle = grd;
context.fill();
context.lineWidth = 5;
context.strokeStyle = "FFCC99";
context.stroke();
////////////////////////////// ////////////////////////////
};
</script>
</head>
<body>
<canvas id="myCanvas" width="800" height="600"></canvas>
</body>
</html>
No comments:
Post a Comment