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 | |
parent | 235a215dc42d395535de11b2cc3dd76543cef088 (diff) |
5/30 Background persists across site, journal
-rw-r--r-- | art.html | 1 | ||||
-rw-r--r-- | cats.html | 1 | ||||
-rw-r--r-- | factorio.html | 1 | ||||
-rw-r--r-- | index.html | 24 | ||||
-rw-r--r-- | rememberBackground.js | 12 | ||||
-rw-r--r-- | silly.html | 2 | ||||
-rw-r--r-- | ultrakill/ultrakill0P.webp | bin | 0 -> 223580 bytes | |||
-rw-r--r-- | ultrakill/ultrakill1P.webp | bin | 0 -> 191666 bytes | |||
-rw-r--r-- | ultrakill/ultrakillP.webp (renamed from ultrakillP.webp) | bin | 189124 -> 189124 bytes |
9 files changed, 40 insertions, 1 deletions
@@ -9,6 +9,7 @@ <link href="styles.css" rel="stylesheet"> <title>Miau - Art</title> <link rel="icon" type="image/x-icon" href="miau.jpg"> + <script src="rememberBackground.js"></script> <script> function hidePages() { let status = document.getElementById("pages").style.display; @@ -9,6 +9,7 @@ <link href="styles.css" rel="stylesheet"> <title>Miau - cats</title> <link rel="icon" type="image/x-icon" href="miau.jpg"> + <script src="rememberBackground.js"></script> <script> function hidePages() { let status = document.getElementById("pages").style.display; diff --git a/factorio.html b/factorio.html index 0e8c5ed..571d6f1 100644 --- a/factorio.html +++ b/factorio.html @@ -9,6 +9,7 @@ <link href="styles.css" rel="stylesheet"> <title>Miau - factorio</title> <link rel="icon" type="image/x-icon" href="miau.jpg"> + <script src="rememberBackground.js"></script> <script> function hidePages() { let status = document.getElementById("pages").style.display; @@ -10,6 +10,7 @@ <link href="styles.css" rel="stylesheet"> <title>Miau :3</title> <link rel="icon" type="image/x-icon" href="miau.jpg"> + <script src="rememberBackground.js"></script> <script> function hidePages() { let status = document.getElementById("pages").style.display; @@ -48,9 +49,30 @@ </div> <div class="title"> Website Journal</div> <div class="content"> + <div class="date">5/30/2025</div> + <p> + I showed off this site to a friend recently, and she said she was disappointed the background + from <a href="silly.html">Silly</a> didn't stay when she changed pages, so I used some of what + I learned from my computer science projects this semester, along with looking at how + <a href="https://goblin-heart.net/" target="_blank">this person</a> did their themes, to make + the images load on other pages. + </p> + <p> + How it works is, on <a href="silly.html">Silly</a>, when you click an available image, it + stores the file name in local storage as "background". Then, whenever a page is loaded, it + changes the background image to whatever that clicked image was. This took far longer than it + needed to, but I learned a lot about using local storage instead of cookies. ^-^ + </p> + <p> + Also I bought Ultrakill and I P ranked the prelude again, as well as layer 1. :3 + </p> + <img src="ultrakill/ultrakill0P.webp" style="width:48%"> + <img src="ultrakill/ultrakill1P.webp" style="width:48%"> + </div> + <div class="content"> <div class="date">5/22/2025</div> <p> - <img src="ultrakillP.webp" style="width:100%"> + <img src="ultrakill/ultrakillP.webp" style="width:100%"> AAAAAAAA look! :3333 </div> <div class="content"> 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 @@ -9,6 +9,7 @@ <link href="styles.css" rel="stylesheet"> <title>Miau - Silly</title> <link rel="icon" type="image/x-icon" href="miau.jpg"> + <script src="rememberBackground.js"></script> <script> function hidePages() { let status = document.getElementById("pages").style.display; @@ -27,6 +28,7 @@ } } function sillyBackground(argument) { + remember(argument); let image = document.body.style.backgroundImage console.log(image); console.log(argument); diff --git a/ultrakill/ultrakill0P.webp b/ultrakill/ultrakill0P.webp Binary files differnew file mode 100644 index 0000000..fc3c865 --- /dev/null +++ b/ultrakill/ultrakill0P.webp diff --git a/ultrakill/ultrakill1P.webp b/ultrakill/ultrakill1P.webp Binary files differnew file mode 100644 index 0000000..3411ea4 --- /dev/null +++ b/ultrakill/ultrakill1P.webp diff --git a/ultrakillP.webp b/ultrakill/ultrakillP.webp Binary files differindex 60122bc..60122bc 100644 --- a/ultrakillP.webp +++ b/ultrakill/ultrakillP.webp |