Snowy scene in javascript for Christmas

Associate
Joined
12 Feb 2013
Posts
1,090
Location
East Mids
Looking through a few old Christmas photographs, decided to create a subtle snowy scene with some simple javascript.

Just something festive for this time of year and a good test of skills in making something slightly more interesting that forum validation in JS.

Hope you guy enjoy it.
Maybe come up with your own variants by modifying the script. :D

 
Might need to adjust for different resolutions, or set the window open size limits - it has tiled on mine and all snowy goodness effect has been lost now. Bah Humbug :p
 
I had an issue with image tiling like that also.

How can you make it so that an image scales to fit a certain div size? No matter the resolution?

Nice JS tidbit there btw.
 
I'm trying to cover a certain area of the page though, not the entire page.

It shouldn't matter. Apply the image as a background to the div, section, article or wherever it is you want it and then use background-size to make it fill as you want.

I can whip up a quick example for you, if it'll help?
 
Thanks for the tips Tripnologist, adjusted the files so the image covers the screen. Thought about using media queries to swap the image for different resolutions but it seems to work great as is.
 
Back
Top Bottom