Refresh the pages a few times. They’re pretty.
There’s a randomly-chosen random background on the bottom of this page, too.
There are three generators in the repository:
And one controller:
And one test page:
Each generator receives an object specifying things like the number of elements to create, upper and lower bounds for colors, the element to append the elements it generates to, etc. There are sample parameters at the bottom of each file. Or you can pass it nothing and let the generator generate the values it needs itself.
The only thing that you must provide is the target element.
This looks best when the target element spans the full height and width of the page.
bg-loader.js file contains a few functions used by the generators, but can also randomly choose a random generator. So rather than calling, e.g.,
new Circles(), you can call
new BackgroundLoader(), and in return you’ll get a random random background. That’s what the pages on this site use.