Wednesday, September 4, 2013

I think I'm finally getting the hang of this whole blog thing and HTML! Woo!


<body>
<canvas id="myCanvas" width="600" height="600"></canvas>
<script>
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');

//BACKGROUND
context.beginPath();
context.rect(0, 0, 600, 600);

var grd = context.createLinearGradient(600, 150, canvas.width, canvas.height);
//blue
grd.addColorStop(0, "rgb(30, 200, 300)");
//blue
grd.addColorStop(1, "rgb(75, 115, 275)");
context.fillStyle = grd;
context.fill();

//MID BUBBLE
var centerX = canvas.width / 4;
var centerY = canvas.height / 3;
var radius = 35;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgba(22,222,195,.8)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "rgba(12,138,121,.8)";
context.stroke();

//FISH
var centerX = canvas.width / 2;
var centerY = canvas.height / 2;
var radius = 84;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//BOTTOM LIP
var centerX = canvas.width / 3;
var centerY = canvas.height / 2;
var radius = 26;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(245,94,167)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "pink";
context.stroke();

//TOP LIP
var centerX = canvas.width / 3;
var centerY = canvas.height / 2.3;
var radius = 26;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(245,94,167)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "pink";
context.stroke();

//DORSAL FIN
var centerX = canvas.width / 2.2;
var centerY = canvas.height / 2.8;
var radius = 30;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//DORSAL FIN
var centerX = canvas.width / 1.9;
var centerY = canvas.height / 2.8;
var radius = 26;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//DORSAL FIN
var centerX = canvas.width / 1.7;
var centerY = canvas.height / 2.7;
var radius = 22;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//TAIL FIN CENTER
var centerX = canvas.width / 1.5;
var centerY = canvas.height / 2;
var radius = 32;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//TAIL FIN TOP
var centerX = canvas.width / 1.4;
var centerY = canvas.height / 2.3;
var radius = 24;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//TAIL FIN END
var centerX = canvas.width / 1.3;
var centerY = canvas.height / 2.3;
var radius = 16;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//TAIL FIN BOTTOM
var centerX = canvas.width / 1.4;
var centerY = canvas.height / 1.8;
var radius = 24;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//TAIL FIN END
var centerX = canvas.width / 1.3;
var centerY = canvas.height / 1.8;
var radius = 16;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//PECTORAL FIN FIRST
var centerX = canvas.width / 2;
var centerY = canvas.height / 1.5;
var radius = 20;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//PECTORAL FIN MID
var centerX = canvas.width / 2.2;
var centerY = canvas.height / 1.6;
var radius = 22;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//PECTORAL FIN LAST
var centerX = canvas.width / 1.8;
var centerY = canvas.height / 1.5;
var radius = 14;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgb(239,151,11)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "orange";
context.stroke();

//EYEBALL
var centerX = canvas.width / 2.5;
var centerY = canvas.height / 2.1579;
var radius = 26;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "black";
context.fill();
context.lineWidth = 8;
context.strokeStyle = "white";
context.stroke();

//TOP BUBBLE
var centerX = canvas.width / 2;
var centerY = canvas.height / 7;
var radius = 27;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgba(22,222,195,.8)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "rgba(12,138,121,.8)";
context.stroke();

//MID BUBBLE
var centerX = canvas.width / 3;
var centerY = canvas.height / 7;
var radius = 15;

context.beginPath();
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
context.fillStyle = "rgba(22,222,195,.8)";
context.fill();
context.lineWidth = 3;
context.strokeStyle = "rgba(12,138,121,.8)";
context.stroke();

</script>
</body>

No comments:

Post a Comment