Merge pull request #64 from AprilNEA/fix-theme

Fix broswer tasklist and support safari webapp #54
This commit is contained in:
Yifei Zhang 2023-03-27 17:44:21 +08:00 committed by GitHub
commit 492fed6802
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -399,11 +399,16 @@ function useSwitchTheme() {
useEffect(() => { useEffect(() => {
document.body.classList.remove("light"); document.body.classList.remove("light");
document.body.classList.remove("dark"); document.body.classList.remove("dark");
if (config.theme === "dark") { if (config.theme === "dark") {
document.body.classList.add("dark"); document.body.classList.add("dark");
} else if (config.theme === "light") { } else if (config.theme === "light") {
document.body.classList.add("light"); document.body.classList.add("light");
} }
const themeColor = getComputedStyle(document.body).getPropertyValue("--theme-color").trim();
const metaDescription = document.querySelector('meta[name="theme-color"]');
metaDescription?.setAttribute('content', themeColor);
}, [config.theme]); }, [config.theme]);
} }

View File

@ -13,6 +13,11 @@ const COMMIT_ID = process
export const metadata = { export const metadata = {
title: "ChatGPT Next Web", title: "ChatGPT Next Web",
description: "Your personal ChatGPT Chat Bot.", description: "Your personal ChatGPT Chat Bot.",
appleWebApp: {
title: "ChatGPT Next Web",
statusBarStyle: "black-translucent",
},
themeColor: "#fafafa"
}; };
function Meta() { function Meta() {

View File

@ -7,6 +7,7 @@
--second: rgb(231, 248, 255); --second: rgb(231, 248, 255);
--hover-color: #f3f3f3; --hover-color: #f3f3f3;
--bar-color: rgba(0, 0, 0, 0.1); --bar-color: rgba(0, 0, 0, 0.1);
--theme-color: var(--gray);
/* shadow */ /* shadow */
--shadow: 50px 50px 100px 10px rgb(0, 0, 0, 0.1); --shadow: 50px 50px 100px 10px rgb(0, 0, 0, 0.1);
@ -28,6 +29,8 @@
--bar-color: rgba(255, 255, 255, 0.1); --bar-color: rgba(255, 255, 255, 0.1);
--border-in-light: 1px solid rgba(255, 255, 255, 0.192); --border-in-light: 1px solid rgba(255, 255, 255, 0.192);
--theme-color: var(--gray);
} }
.light { .light {
@ -85,6 +88,10 @@ body {
user-select: none; user-select: none;
font-family: "Noto Sans SC", "SF Pro SC", "SF Pro Text", "SF Pro Icons", font-family: "Noto Sans SC", "SF Pro SC", "SF Pro Text", "SF Pro Icons",
"PingFang SC", "Helvetica Neue", "Helvetica", "Arial", sans-serif; "PingFang SC", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
@media only screen and (max-width: 600px) {
background-color: var(--second);
}
} }
::-webkit-scrollbar { ::-webkit-scrollbar {