Compare commits
No commits in common. "e2ad52ed3c6bb5803cedc5752236d720ce6943b9" and "8f33ff2a4ea3f202e868ab2f21c069e693f334dc" have entirely different histories.
e2ad52ed3c
...
8f33ff2a4e
3 changed files with 21 additions and 44 deletions
|
|
@ -133,59 +133,43 @@ window.onload = function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var css_url = "/Y/ystyle.css"
|
|
||||||
|
|
||||||
if (typeof(Storage) !== "undefined") {
|
if (typeof(Storage) !== "undefined") {
|
||||||
var theme = localStorage.getItem("theme");
|
var theme = localStorage.getItem("theme");
|
||||||
console.log("theme : " + theme)
|
console.log("theme : " + theme)
|
||||||
if (theme == "null" || theme == null || theme == "undefined" || theme == undefined) {
|
|
||||||
|
if (theme === "/Y/ystyle.css") {
|
||||||
|
css_url = "/Y/ystyle.css";
|
||||||
|
} else if (theme === "/Y/ystyle2.css") {
|
||||||
|
css_url = "/Y/ystyle2.css";
|
||||||
|
changeCSS(css_url, 0)
|
||||||
|
} else {
|
||||||
// Get default value
|
// Get default value
|
||||||
css_url = "/Y/ystyle.css";
|
css_url = "/Y/ystyle.css";
|
||||||
} else {
|
|
||||||
css_url = theme;
|
|
||||||
changeCSS(css_url, 0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var toggler = document.createElement("select")
|
var toggler = document.createElement("a")
|
||||||
|
toggler.setAttribute("id", "toggler")
|
||||||
var liste = ["/Y/ystyle.css","/Y/ystyle2.css"];
|
|
||||||
|
|
||||||
toggler.id = "toggler";
|
|
||||||
document.body.appendChild(toggler)
|
|
||||||
|
|
||||||
let i = 1;
|
|
||||||
|
|
||||||
//Create and append the options
|
|
||||||
for (let opt of liste) {
|
|
||||||
let option = document.createElement("option");
|
|
||||||
option.value = opt;
|
|
||||||
option.text = "style " + i.toString();
|
|
||||||
i++;
|
|
||||||
if (option.value == css_url) {
|
|
||||||
option.selected = "selected"
|
|
||||||
}
|
|
||||||
option.style.outline = "none"
|
|
||||||
option.style.border = "none"
|
|
||||||
toggler.appendChild(option);
|
|
||||||
}
|
|
||||||
|
|
||||||
toggler.style.position = "absolute"
|
toggler.style.position = "absolute"
|
||||||
toggler.style.top = "18px"
|
toggler.style.top = "12px"
|
||||||
toggler.style.right = "15px"
|
toggler.style.right = "12px"
|
||||||
toggler.style.padding = "10px"
|
toggler.style.padding = "10px"
|
||||||
toggler.style.borderRadius = "7px"
|
toggler.style.borderRadius = "7px"
|
||||||
toggler.style.background = "#335"
|
toggler.style.background = "#335"
|
||||||
toggler.style.border = "none"
|
|
||||||
toggler.style.appearance = "none"
|
|
||||||
toggler.style.color = "#eee"
|
toggler.style.color = "#eee"
|
||||||
toggler.style.zIndex = "12"
|
toggler.style.zIndex = "12"
|
||||||
|
toggler.innerHTML = "theme"
|
||||||
toggler.style.cursor = "pointer"
|
toggler.style.cursor = "pointer"
|
||||||
toggler.style.outline = "none"
|
toggler.addEventListener("click", function() {
|
||||||
toggler.addEventListener("change", function() {
|
if (css_url == "/Y/ystyle.css") {
|
||||||
css_url = toggler.value
|
css_url = "/Y/ystyle2.css";
|
||||||
|
} else {
|
||||||
|
css_url = "/Y/ystyle.css";
|
||||||
|
}
|
||||||
changeCSS(css_url, 0)
|
changeCSS(css_url, 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
document.body.appendChild(toggler)
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeCSS(css_file, cssLinkIndex) {
|
function changeCSS(css_file, cssLinkIndex) {
|
||||||
|
|
@ -193,7 +177,7 @@ function changeCSS(css_file, cssLinkIndex) {
|
||||||
localStorage.setItem("theme", css_file);
|
localStorage.setItem("theme", css_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("changing css to " + css_file)
|
console.log("changing css")
|
||||||
|
|
||||||
var oldlink = document.getElementsByTagName("link").item(cssLinkIndex);
|
var oldlink = document.getElementsByTagName("link").item(cssLinkIndex);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -477,13 +477,6 @@ img:hover {
|
||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* General styling */
|
|
||||||
|
|
||||||
::selection {
|
|
||||||
background-color: #113e9e;
|
|
||||||
color: lightgoldenrodyellow;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* MEDIA */
|
/* MEDIA */
|
||||||
@media (min-width: 1400px) {
|
@media (min-width: 1400px) {
|
||||||
footer {
|
footer {
|
||||||
|
|
|
||||||
BIN
favicon.ico
BIN
favicon.ico
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in a new issue