From 9507fa48215779e00342536419400a912a4dbeb2 Mon Sep 17 00:00:00 2001 From: AlmightyMiau Date: Sat, 31 May 2025 00:37:33 -0700 Subject: 5/30 Background persists across site, journal --- rememberBackground.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 rememberBackground.js (limited to 'rememberBackground.js') 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 -- cgit v1.2.3