turns out this code was important
This commit is contained in:
parent
1c1999f54a
commit
20acf67992
2 changed files with 18 additions and 1 deletions
|
@ -51,3 +51,20 @@ function swapScheme(scheme) {
|
||||||
document.getElementById("css-colorscheme").href = `/css/colorschemes/${scheme}.css`;
|
document.getElementById("css-colorscheme").href = `/css/colorschemes/${scheme}.css`;
|
||||||
console.log(`Set colorscheme to ${getCookie("colorscheme")}`)
|
console.log(`Set colorscheme to ${getCookie("colorscheme")}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setSchemeSelector() {
|
||||||
|
if (!cookieExists("colorscheme")) {
|
||||||
|
setCookie("colorscheme", "catppuccin-macchiato", 90);
|
||||||
|
} else {
|
||||||
|
const scheme = getCookie("colorscheme");
|
||||||
|
const schemeselector = document.getElementById("scheme-selector");
|
||||||
|
if (scheme && schemeselector) {
|
||||||
|
for (let option of schemeselector.options) {
|
||||||
|
if (option.value == scheme) {
|
||||||
|
option.selected = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
@include('includes.head')
|
@include('includes.head')
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body onload="setSchemeSelector()">
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div id="header" class="header">
|
<div id="header" class="header">
|
||||||
@include('includes.header')
|
@include('includes.header')
|
||||||
|
|
Loading…
Reference in a new issue