summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rememberBackground.js8
-rw-r--r--silly.html1
2 files changed, 8 insertions, 1 deletions
diff --git a/rememberBackground.js b/rememberBackground.js
index 3cdc4de..8edfc88 100644
--- a/rememberBackground.js
+++ b/rememberBackground.js
@@ -4,9 +4,15 @@ function remember(img) {
function recall() {
if (localStorage.getItem("background")) {
console.log(localStorage.getItem("background"));
- document.body.style.backgroundImage = 'url("https://almightymiau.gay/' + localStorage.getItem("background") + '")';
+ document.body.style.backgroundImage = "url('" + localStorage.getItem("background") + "')";
+ }
+}
+function setup() {
+ for (let image of document.getElementsByTagName("img")) {
+ image.onclick = function() {sillyBackground(image.src)};
}
}
window.onload = () => {
recall();
+ setup();
} \ No newline at end of file
diff --git a/silly.html b/silly.html
index b8f0fde..87fb289 100644
--- a/silly.html
+++ b/silly.html
@@ -44,6 +44,7 @@
console.log(argument);
if (image == argument) {
document.body.style.backgroundImage = "url('backgrounds/stars3.gif')";
+ remember("backgrounds/stars3.gif");
} else {
document.body.style.backgroundImage = argument;
}