Skip to content

Instantly share code, notes, and snippets.

@miketaylr
Created February 16, 2010 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketaylr/305959 to your computer and use it in GitHub Desktop.
Save miketaylr/305959 to your computer and use it in GitHub Desktop.
//lines
var ctx = $('#c')[0].getContext('2d');
ctx.lineWidth = 20;
ctx.lineCap = 'square';
ctx.lineJoin = 'round';
ctx.strokeStyle = 'rgb(247, 63, 20)';
ctx.beginPath();
ctx.moveTo(15,15);
ctx.lineTo(163,140);
ctx.lineTo(203, 140);
ctx.lineTo(351, 15);
ctx.stroke();
ctx.closePath();
//rectangle!
ctx.strokeRect(10, 10, 346, 230);
//put it together!
//image
var kitty = new Image();
kitty.src = 'http://i954.photobucket.com/albums/ae30/rte148/891blog_keyboard_cat.gif';
kitty.onload = function(){
ctx.drawImage(this, 99,0,this.width, this.height);
};
ctx.rotate(0.35);
//text on kitty
ctx.font = '68px KulminoituvaRegular';
ctx.fillStyle = 'orangered';
ctx.textBaseline = 'top';
ctx.fillText ('Keyboard Cat', 0, 270);
//shadow
ctx.shadowOffsetX = 3;
ctx.shadowOffsetY = 3;
ctx.shadowBlur = 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment