Snow with HTML Canvas

On the HTML5 Rocks webite they’ve added snow to the main banner area.

It’s very interesting to see how they’ve done it, you can get some ideas for your next project.

snow4

Canvas to the rescue

Yep, this black magic snow uses HTML canvas to create the area where the snow is gonna fall. So first of all we need a container:

That’s it, next thing…

Sweet JavaScript

No libraries, frameworks or any dirty code. Just plain and simple JavaScript. You’ll probably want some information about Canvas first so here it is:

Now ready or not here comes the code:

View Demo

No comments yet, leave yours!

Leave a Reply

Add <code> Some Code </code> by using this tags.