Posts tagged canvas
Tips & Tricks: Cheat Sheets For Web People
2I have a set of blogs that I read every day, some are really technical, and I learn lots, and others are more inspirational, they show me the cool stuff that we as web designers and web developers can build.
I’ll admit that one of the blogs I read has the educational value of something you’d pick up at a grocery store check out, the pictures are really pretty, and it’s good inspiration, but I’d never actually walk out of the store with it. Well today, they posted an article that changed my mind. Almost! One of today’s posts was a collection of cheat sheets for web designers and developers, and I wanted to share my favorites.
HTML4 and HTML5 Cheat Sheets
HTML5 Visual Cheat Sheet from http://woorkup.com/
I think came in as my favorite and prettiest cheat sheet. It prints on an 11×17 piece of paper, and is a great reference for all of the HTML4 and HTML5 tags that you’ll ever need to reference. It nicely includes the attributes that you can set, what version of the HTML spec they’re from and lots more useful information.
HTML5 Reference Guide from http://veign.com/
The Veign folks go into a lot more detail on their cheat sheet, or more accurately, cheat sheets because this guy is 4 pages long. One of the things I like about this one was that it goes in to much further depth about the attributes, supported HTML versions (indicating elements that aren’t supported in HTML5 with a highlight), and a very brief description of the element.
HTML Character Entity Reference from http://addedbytes.com/
I’ve often found myself forgetting what the special character sequence is to get a particular character to show up, or I’ll be looking for a character to use in my breadcrumb navigation – this cheat sheet solves that and lists all of the characters and their sequence to get exactly what you want!
Canvas Cheat Sheet from http://blog.nihilogic.dk
Canvas is one of those things that’s super new to a lot of folks, so having a handy cheat sheet is really useful! It’s not going to be super-useful for beginners since it’s basically just the API reference, but once you have a pretty good handle on Canvas, this will be a great desk reference until it gets cemented in your brain.
CSS2 and CSS3 Cheat Sheets
CSS2 Reference from http://veign.com
Those folks over at Veign are pretty good at putting together a reference sheet, maybe not as pretty as some of the other ones, but just as functional and makes my life easier, so I’m not complaining! Their CSS2 reference is great and provides all the detail you’ll need if you need to look something up quickly!
CSS3 Reference from http://veign.com
The CSS3 reference isn’t quite as awesome as the HTML5 reference, because they don’t tell you what properties are CSS3 vs CSS2, so if you’re having to code for multiple browsers like most folks, you may accidentally add something and then scratch your head as to why it’s not working in an older browser.
Other Useful Cheat Sheets
JavaScript Cheat Sheet from http://addedbytes.com
For whatever reason, JavaScript and I don’t get along, I think it’s because I like strongly typed languages that tell me if I’ve done something wrong before it gets there. If you’re building websites and not using a tool that doesn’t have intellisense, then having a cheat sheet like this would be super valuable. All the APIs you’ll need, right at your fingertips!
SEO Cheat Sheet from http://www.seomoz.org
A week or so ago, I posted my tips and tricks for ensuring your site was best optimized to make it into search engines efficiently. Here’s another great easy to follow cheat sheet that will help you make the best of the time and resources that you have on getting your site optimized. It’s a great resource to look over and share with co-workers or friends when they ask why you’re doing something!
Summary
There you go, those are the quick reference guides that are now printed and sitting on my bulletin board beside my desk at work! Hopefully you’ll find a good nugget or two in there as well! If you’ve got other good references or cheat sheets, be sure to share them with me!
A Quick Intro: Canvas in IE9
1Yesterday, with the release of Internet Explorer 9 Platform Preview 3, the engineering team announced support for hardware accelerated <canvas>! The <canvas> element is a part of the HTML5 Standards specification and allows for dynamic scriptable rendering of 2D graphics. To use it, you put a simple <canvas> element in your HTML, which defines the drawing area, then through JavaScript, you can get the 2d context and begin dynamically drawing within that region.
Much like SVG, you can draw on the page using basic shapes, but you can also easily include rasterized images, videos and other objects. But unlike SVG, when you draw on the page, the browser doesn’t remember any of the “drawings”. With SVG, the “drawings” just become elements in the DOM and you can script them, change them, basically treat them like any other element. Canvas on the other hand, doesn’t remember the state of the “drawings” so you can’t change them as easily.
Quick Code Sample
<canvas id="myCanvas" width="200" height="200"
style="border: 1px solid black;">
Your browser doesn’t support Canvas, sorry.
</canvas>
var canvasElement = document.getElementById("myCanvas");
if (canvasElement.getContext) {
// The Context exists, so we know we have a canvas element
// we can work with.
var context = canvasElement.getContext("2d");
context.fillStyle = "rgb(255,0,0)";
context.fillRect(30, 30, 50, 50);
}
else {
// There is no Context, so we can't do anything.
// Put fall back code here.
}
Results in…
The More Exciting Stuff…
Okay, so I can draw a little red box on a page, woop-de-doo right! This is when I recommend you check out the IETestDrive.com website where the truly cool demos are. Be sure when you’re looking at these demos that you take a minute to look at the source code as well – it’s pretty interesting to see how few lines of HTML are required, and in many cases how few lines of JavaScript as well!
- Amazon Shelf – A visualization of Amazon’s top books and a way to read a bit more into them
- FishIE Tank – Remember the Windows 7 beta fish, he’s back!
- Mr. Potato Gun – Mr. Potato plus what looks like an air canon is never good for Mr. Potato!
- Asteroid Belt – be sure to look at the HTML for this one, there really isn’t any!
- DeemZoom – this is truly making web apps native!
- Canvas Pad – An interactive canvas drawing app
Enjoy!
PEte

