Many sites these days have ‘theming’ functionality, when user is able to customize the pages’ look. Sometimes it’s only a fixed set of themes, but sometimes people are free to choose any style they want – for example, they can set up any color of the pages’ background.
I want to go a step further – and let them choose the background image as well. The flow is very simple: user uploads a file (via <input type="file" />), then this file becomes a background image – but only for this user.
I can’t find anything about this functionality online, though, and I have no clue about what to do.
Something else I was thinking was that, if a user selects a background, maybe I could use HTML5 localstorage to make that background come up every-time that visitor visits the page.
Here’s a proof of concept (mostly based on the code given at MDN FileReader doc page + this answer):
HTML:
JS: no wrap (head) mode
And here’s a working demo, checked in latest Firefox and Chrome versions. Looks to work OK, at least. )