It would be cool if people could set up some standard things like maybe the titles of each row and have that saved for the next time they come back. The Web Storage API looks like a good way to do this:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
This links to example files in GitHub that create a landing page where you can play around with storing the background color, font, and an image. Files look pretty simple actually.
for example, using localStorage with setItem and getItem
var htmlElem = document.querySelector('html');
var pElem = document.querySelector('p');
var imgElem = document.querySelector('img');
var bgcolorForm = document.getElementById('bgcolor');
var fontForm = document.getElementById('font');
var imageForm = document.getElementById('image');
if(!localStorage.getItem('bgcolor')) {
populateStorage();
} else {
setStyles();
}
function populateStorage() {
localStorage.setItem('bgcolor', document.getElementById('bgcolor').value);
localStorage.setItem('font', document.getElementById('font').value);
localStorage.setItem('image', document.getElementById('image').value);
setStyles();
}
function setStyles() {
var currentColor = localStorage.getItem('bgcolor');
var currentFont = localStorage.getItem('font');
var currentImage = localStorage.getItem('image');
document.getElementById('bgcolor').value = currentColor;
document.getElementById('font').value = currentFont;
document.getElementById('image').value = currentImage;
htmlElem.style.backgroundColor = '#' + currentColor;
pElem.style.fontFamily = currentFont;
imgElem.setAttribute('src', currentImage);
}
bgcolorForm.onchange = populateStorage;
fontForm.onchange = populateStorage;
imageForm.onchange = populateStorage;
It would be cool if people could set up some standard things like maybe the titles of each row and have that saved for the next time they come back. The Web Storage API looks like a good way to do this:
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
This links to example files in GitHub that create a landing page where you can play around with storing the background color, font, and an image. Files look pretty simple actually.
for example, using localStorage with setItem and getItem