From 303966441d0a92ee260aec49c39971b061b865c7 Mon Sep 17 00:00:00 2001 From: 0xmac Date: Mon, 23 Sep 2024 21:16:38 +0200 Subject: [PATCH] Updated Yotsuba Image rendering; Added futute theme --- global/global.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/global/global.js b/global/global.js index b57d643..34c2eb5 100644 --- a/global/global.js +++ b/global/global.js @@ -64,7 +64,7 @@ funButtons = [ /* Available Themes located in the footer */ var styles = ["Tomorrow", "Forgotten", "Yotsuba"]; - +dirDepth = "" /* Update CSS Colorscheme function for themes */ function updateStyle(type){ @@ -102,15 +102,26 @@ function updateStyle(type){ doc.style.setProperty("--main-title-fg-color", "#7c7c7c"); doc.style.setProperty("--font-family", "FreePixel"); - doc.style.setProperty("--font-size", "15px"); + doc.style.setProperty("--font-size", "13px"); + document.querySelector("body").style.backgroundImage = "none"; + } else if (type == "Neocities"){ + doc.style.setProperty("--main-bg-color", "#282828"); + doc.style.setProperty("--main-bg-end-color", "#458588"); + doc.style.setProperty("--main-color", "#a89984"); + doc.style.setProperty("--main-fg-color", "#282828"); + doc.style.setProperty("--main-title-fg-color", "#7c7c7c"); + + doc.style.setProperty("--font-family", "FreePixel"); + doc.style.setProperty("--font-size", "15px"); + document.querySelector("body").style.backgroundImage = "none"; } } function LoadWebsite(){ - let dirDepth = document.getElementById("toplevel").getAttribute("data-"); + dirDepth = document.getElementById("toplevel").getAttribute("data-"); document.getElementById("toplevel").textContent = ""; const WEBSIDENAME = document.URL; @@ -263,6 +274,10 @@ function LoadWebsite(){ localStorage.setItem("style", event.target.value); updateStyle(event.target.value); }); + + if (localStorage.getItem("style") == "Yotsuba"){ + updateStyle(localStorage.getItem("style")); + } } document.addEventListener("DOMContentLoaded", LoadWebsite);