From 20acf6799253b32ebd3708f776a719a7b013ad89 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Mon, 22 Jan 2024 01:33:40 +0000 Subject: [PATCH] turns out this code was important --- public/js/schemeSwap.js | 17 +++++++++++++++++ resources/views/layouts/default.blade.php | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/public/js/schemeSwap.js b/public/js/schemeSwap.js index de5a6b2..e048f6a 100644 --- a/public/js/schemeSwap.js +++ b/public/js/schemeSwap.js @@ -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; + } + } + } + } +} diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index 996d895..0945b9c 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -4,7 +4,7 @@ @include('includes.head') - +