Wednesday, September 12, 2012

In-class heart! Finally fixed :)

<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");

////////////////////////////////////// start below this line ˇˇˇˇˇˇˇˇˇˇ


// heart variables
var controlX1 = 300;
var controlY1 = 0;
var controlX2 = 100;
var controlY2 = 200;
var endX = 250;
var endY = 325;

var controlX3 = 380;
var controlY3 = 400;
var endX2 = 400;
var endY2 = 500;

var controlX4 = 435;
var controlY4 = 400;
var endX3 = 550;
var endY3 = 325;

var controlX5 = 700;
var controlY5 = 200;
var controlX6 = 500;
var controlY6 = 0;
var endX4 = 400;
var endY4 = 200;

var grdstartX = 0;
var grdstartY = 0;
var grdendX = 800;
var grdendY = 600;


//rectangle
context.beginPath();
context.rect(0, 0, canvas.width, canvas.height);
var grd = context.createLinearGradient(grdstartX, grdstartY, grdendX, grdendY);
  grd.addColorStop(0, 'rgb(102,51,255)');
  grd.addColorStop(1, 'rgb(0,0,102)');
  context.fillStyle = grd;
  context.fill();
context.stroke();


//heart
context.beginPath();
context.moveTo(400,200);
context.bezierCurveTo(controlX1, controlY1, controlX2, controlY2, endX, endY);
context.quadraticCurveTo(controlX3, controlY3, endX2, endY2);
context.quadraticCurveTo(controlX4, controlY4, endX3, endY3);
context.bezierCurveTo(controlX5, controlY5, controlX6, controlY6, endX4, endY4);
  context.fillStyle = 'rgb(153,153,255)';
  context.fill();
    context.lineWidth = 10;
    context.lineCap = 'round';
    context.strokeStyle = 'rgb(102,204,255)';
context.stroke();


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

};

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

Tuesday, September 11, 2012

Homework - September 12th

Homework of a Heart in HTML Coding

 

Code for this picture:


<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function() {
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");

////////////////////////////////////// start below this line

//curve 1
  context.beginPath();
  context.moveTo(125, 200);
   context.quadraticCurveTo(125, 50, 250, 50);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
 
//curve 2
   context.beginPath();
  context.moveTo(250, 50);
   context.quadraticCurveTo(375, 50, 400, 200);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
 
//curve 3
context.beginPath();
  context.moveTo(400, 200);
   context.quadraticCurveTo(425, 50, 550, 50);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
 
//curve 4
  context.beginPath();
  context.moveTo(550, 50);
   context.quadraticCurveTo(675, 50, 675, 200);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
 
//curve 5
context.beginPath();
  context.moveTo(125, 200);
   context.quadraticCurveTo(130, 300, 200, 393);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
   
//curve 6
context.beginPath();
  context.moveTo(675, 200);
   context.quadraticCurveTo(670, 300, 600, 393);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
 
  //curve 7
context.beginPath();
  context.moveTo(200, 393);
   context.quadraticCurveTo(250, 450, 400, 590);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
   
//curve 8
context.beginPath();
  context.moveTo(600, 393);
   context.quadraticCurveTo(550, 450, 400, 590);
   context.lineWidth = 15;
   context.lineCap = 'round';
        // line color
        context.strokeStyle = "black";
  context.stroke();
   
////////////////////////////////////// end above this line

};

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

Monday, August 27, 2012

No words can fully describe me

Hi! My name is Allegra but feel free to call me legs. 

  • This year I am a sophomore at UT with a major in Advertising and Public Relations and I am also a sister of Delta Gamma. I am originally born and raised in Rhode Island but my family recently moved to West Palm Beach Florida. The best way to describe me would be a good time. There is a lot that I live by but most important that happiness isn't perfected until it is shared. I enjoy the company of my family, friends and my dog more than anything, they mean the most to me and I wouldn't be the same without their love and support . Being Italian I enjoy food and especially deserts, if I could go out to dinner every night I would, I also have the worst sweet tooth where I have to have something sweet after every meal to finish it. I love the basic simple things: long naps, great movies, laughing until I cry, days on the beach. 
  • In this class I am really looking to increase my knowledge on Digital Design. With my major I would like to go into Event Planning but knowing how to advertise and create my own projects would be a great asset. I consider myself a creative person so this will give me a chance to see what I can really come up with and apply it to my future career. 

twitter: @nice_legs
instagram: legsmic