Updates Yotsuba Image rendering; Added futute theme

This commit is contained in:
0xmac 2024-09-23 21:16:38 +02:00
parent c02f4db028
commit b89d0bf91c

View File

@ -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){
@ -101,6 +101,17 @@ function updateStyle(type){
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", "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");
@ -110,7 +121,7 @@ function updateStyle(type){
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);