Added "Neocities" Theme

This commit is contained in:
0xmac 2024-09-26 10:21:33 +02:00
parent 0523157649
commit 23bad5e922
3 changed files with 49 additions and 19 deletions

BIN
global/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -62,16 +62,25 @@ funButtons = [
];
/* Available Themes located in the footer */
var styles = ["Tomorrow", "Forgotten", "Yotsuba"];
var styles = ["Neocities", "Tomorrow", "Forgotten", "Yotsuba"];
dirDepth = ""
/* Update CSS Colorscheme function for themes */
function updateStyle(type){
function resetBackground(){
try {
document.querySelector("body").style.backgroundImage = "none";
document.querySelector("body").style.backgroundRepeat = "repeat-x";
document.querySelector("body").style.backgroundPosition = "top";
document.querySelector("body").style.backgroundBlendMode = "normal";
} catch { }
}
var doc = document.documentElement;
/* If type = undefined, default to "tomorrow" */
if (type == undefined){ type = "Tomorrow"; }
if (type == undefined){ type = "Neocities"; }
if (type == "Yotsuba"){
doc.style.setProperty("--main-bg-color", "#fed6af");
doc.style.setProperty("--main-bg-end-color", "#ffffee");
@ -82,7 +91,10 @@ function updateStyle(type){
doc.style.setProperty("--font-family", "Arial, Helvetica, sans-serif");
doc.style.setProperty("--font-size", "13px");
document.querySelector("body").style.backgroundImage = "url(" + dirDepth + "global/fade.png)";
resetBackground();
try {
document.querySelector("body").style.backgroundImage = "url(" + dirDepth + "global/fade.png)";
} catch { }
} else if (type == "Tomorrow"){
doc.style.setProperty("--main-bg-color", "#1d1f21");
doc.style.setProperty("--main-bg-end-color", "#1d1f21");
@ -93,7 +105,7 @@ function updateStyle(type){
doc.style.setProperty("--font-family", "Arial, Helvetica, sans-serif");
doc.style.setProperty("--font-size", "13px");
document.querySelector("body").style.backgroundImage = "none";
resetBackground();
} else if (type == "Forgotten"){
doc.style.setProperty("--main-bg-color", "#282828");
doc.style.setProperty("--main-bg-end-color", "#458588");
@ -104,27 +116,33 @@ function updateStyle(type){
doc.style.setProperty("--font-family", "FreePixel");
doc.style.setProperty("--font-size", "13px");
document.querySelector("body").style.backgroundImage = "none";
resetBackground();
} 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("--main-bg-color", "#000000");
doc.style.setProperty("--main-bg-end-color", "#468184");
doc.style.setProperty("--main-color", "#00000055");
doc.style.setProperty("--main-fg-color", "#ffffff");
doc.style.setProperty("--main-title-fg-color", "#2c9080");
doc.style.setProperty("--font-family", "FreePixel");
doc.style.setProperty("--font-size", "15px");
document.querySelector("body").style.backgroundImage = "none";
try {
document.querySelector("body").style.backgroundImage = "url(" + dirDepth + "global/bg.png)";
document.querySelector("body").style.backgroundRepeat = "repeat";
document.querySelector("body").style.backgroundBlendMode = "overlay";
} catch { }
}
}
function ButtonToggle(checkstate){
if (checkstate){
document.querySelector(".button-container").style.display = "flex";
} else {
document.querySelector(".button-container").style.display = "none";
}
try {
if (checkstate){
document.querySelector(".button-container").style.display = "flex";
} else {
document.querySelector(".button-container").style.display = "none";
}
} catch { }
}
function LoadWebsite(){
@ -260,6 +278,12 @@ function LoadWebsite(){
button_span.appendChild(button_check_buttons);
button_span.appendChild(button_check_label);
if (document.getElementById("please-no-buttons") != null){
button_check_buttons.checked = false;
button_check_label.disabled = true;
button_check_buttons.disabled = true;
}
button_span.appendChild(button_select_label);
button_select_label.appendChild(button_select);
@ -318,7 +342,7 @@ function LoadWebsite(){
updateStyle(event.target.value);
});
if (localStorage.getItem("style") == "Yotsuba"){
if (localStorage.getItem("style") == "Yotsuba" || localStorage.getItem("style") == "Neocities" || localStorage.getItem("style") == undefined){
updateStyle(localStorage.getItem("style"));
}
}

View File

@ -13,7 +13,11 @@ body {
color:var(--main-fg-color);
background: var(--main-bg-end-color) url(../src/fade.png) top repeat-x;
background-image: url(../global/fade.png);
background-repeat: repeat-x;
background-position: top;
background-color: var(--main-bg-end-color);
background-position: left;
margin:0;
padding-bottom:26px;
@ -62,6 +66,8 @@ nav{
width: 80%;
float:left;
margin-bottom: 20px;
background-color: var(--main-title-fg-color);
border-color: var(--main-title-fg-color);
}
main{