Plain backgrounds are plain. Spice up your pages with random backgrounds.
There are three generators:
And one controller:
And one test page:
- Download the files
- Add them to your pages
- There is no step 3
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.
Refresh the pages a few times. They're pretty.
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.