Let's say I have a <div>
rectangle sized 1400x700 pixels. Let's call it a "canvas."
I want to fill it with a number of enlarged "pixels" if you will - squares of random color and opacity. Randomly. Some will fade in, some will fade out. That's easy enough.
The HTML structure should look like:
div#canvas
div.pixel
div.pixel
div.pixel
div.pixel
How do I take the original dimensions of the rectangle and arrive at a number of square divs that are guaranteed to fill the whole "canvas" to the brim?
The size of the squares should be variable somehow. The idea is to "pixelate" the background image but in an undulating fashion, though that's a mental issue and not a programming one.