diff --git a/public/market.js b/public/market.js
index 7657758..286c9ba 100644
--- a/public/market.js
+++ b/public/market.js
@@ -104,6 +104,10 @@ function applyTheme(themeKey) {
});
}
+function applyThemeMode(modeKey) {
+ document.body.dataset.themeMode = modeKey === "dark" ? "dark" : "light";
+}
+
function setMarketStatus(message, state = "") {
marketStatus.textContent = message;
marketStatus.className = state ? `status persona-status ${state}` : "status persona-status";
@@ -701,6 +705,7 @@ marketPersonaForm.addEventListener("submit", (event) => {
window.addEventListener("load", async () => {
applyTheme(localStorage.getItem("krishd-theme") || "fakegpt");
+ applyThemeMode(localStorage.getItem("krishd-theme-mode") || "light");
const params = new URLSearchParams(window.location.search);
setMarketSort("assistant", params.get("assistantSort") || "best", {reload: false});
setMarketSort("user", params.get("userSort") || "best", {reload: false});
diff --git a/public/script.js b/public/script.js
index bac4e1b..615a27c 100644
--- a/public/script.js
+++ b/public/script.js
@@ -858,6 +858,12 @@ function applyTheme(themeKey, persist = true) {
renderModelSection();
}
+function applyThemeMode(modeKey, persist = true) {
+ const nextMode = modeKey === "dark" ? "dark" : "light";
+ document.body.dataset.themeMode = nextMode;
+ if (persist) localStorage.setItem("krishd-theme-mode", nextMode);
+}
+
function updateChatActionState() {
const activeChat = getChatById(activeChatId);
const hasChat = Boolean(activeChat);
@@ -1742,6 +1748,7 @@ document.addEventListener("keydown", (event) => {
});
window.addEventListener("load", async () => {
applyTheme(localStorage.getItem("krishd-theme") || "fakegpt", false);
+ applyThemeMode(localStorage.getItem("krishd-theme-mode") || "light", false);
applyWorkspaceMode(localStorage.getItem("krishd-workspace-mode") || "basic", false);
setNotice("Ready.");
updateChatActionState();
diff --git a/public/settings.html b/public/settings.html
index 0686dd7..4b22d23 100644
--- a/public/settings.html
+++ b/public/settings.html
@@ -122,6 +122,13 @@
+