diff options
author | AlmightyMiau <almightymeow612@gmail.com> | 2025-05-31 00:37:33 -0700 |
---|---|---|
committer | AlmightyMiau <almightymeow612@gmail.com> | 2025-05-31 00:37:33 -0700 |
commit | 9507fa48215779e00342536419400a912a4dbeb2 (patch) | |
tree | cedb45d0e6a0149927abf183f1c586ace2585ba0 /rememberBackground.js | |
parent | 235a215dc42d395535de11b2cc3dd76543cef088 (diff) |
5/30 Background persists across site, journal
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 |