Woops #2

Closed
RoscoeDaWah wants to merge 250 commits from redesign into master
2 changed files with 18 additions and 1 deletions
Showing only changes of commit 20acf67992 - Show all commits

View file

@ -51,3 +51,20 @@ function swapScheme(scheme) {
document.getElementById("css-colorscheme").href = `/css/colorschemes/${scheme}.css`;
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;
}
}
}
}
}

View file

@ -4,7 +4,7 @@
@include('includes.head')
</head>
<body>
<body onload="setSchemeSelector()">
<div class="page">
<div id="header" class="header">
@include('includes.header')