diff options
Diffstat (limited to 'rememberBackground.js')
-rw-r--r-- | rememberBackground.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rememberBackground.js b/rememberBackground.js new file mode 100644 index 0000000..3cdc4de --- /dev/null +++ b/rememberBackground.js @@ -0,0 +1,12 @@ +function remember(img) { + localStorage.setItem('background', img); +} +function recall() { + if (localStorage.getItem("background")) { + console.log(localStorage.getItem("background")); + document.body.style.backgroundImage = 'url("https://almightymiau.gay/' + localStorage.getItem("background") + '")'; + } +} +window.onload = () => { + recall(); +}
\ No newline at end of file |