Created
February 16, 2010 21:39
-
-
Save miketaylr/305959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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