From 8edb1c63695921ad65e0a3abcc04b66561f991c6 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Mon, 5 Dec 2022 18:31:18 +0000 Subject: Light mode begone --- res/js/themeswap.js | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100755 res/js/themeswap.js (limited to 'res/js/themeswap.js') diff --git a/res/js/themeswap.js b/res/js/themeswap.js deleted file mode 100755 index e619471..0000000 --- a/res/js/themeswap.js +++ /dev/null @@ -1,26 +0,0 @@ -function addStyleSheet(name, id) { - var path = '/res/css/' + name + '.css'; - var old = document.getElementById(id); - if (old && (old.href != path)) { - old.href = path; - } -} - -var otherTheme = { - 'dark': 'light', - 'light': 'dark', -}; - -var currentTheme = localStorage.getItem('theme'); - -if (!otherTheme.hasOwnProperty(currentTheme)) { - currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; -} - -addStyleSheet(currentTheme, 'theme'); - -function toggleTheme() { - currentTheme = otherTheme[currentTheme] || 'light'; - localStorage.setItem('theme', currentTheme); - addStyleSheet(currentTheme, 'theme'); -} -- cgit v1.2.3-54-g00ecf