diff --git a/src/components/LightDarkSwitch.svelte b/src/components/LightDarkSwitch.svelte deleted file mode 100644 index b676c7b..0000000 --- a/src/components/LightDarkSwitch.svelte +++ /dev/null @@ -1,79 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 2ee0c8b..6d957ff 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -4,10 +4,9 @@ import { navBarConfig, siteConfig } from "../config"; import { LinkPresets } from "../constants/link-presets"; import { LinkPreset, type NavBarLink } from "../types/config"; import { url } from "../utils/url-utils"; -import LightDarkSwitch from "./LightDarkSwitch.svelte"; import Search from "./Search.svelte"; -import DisplaySettings from "./widget/DisplaySettings.svelte"; import NavMenuPanel from "./widget/NavMenuPanel.astro"; +import ThemeSettingsBlock from "./widget/ThemeSettingsBlock.svelte"; const className = Astro.props.class; @@ -28,7 +27,7 @@ let links: NavBarLink[] = navBarConfig.links.map(
- + {siteConfig.title}
@@ -39,7 +38,7 @@ let links: NavBarLink[] = navBarConfig.links.map( >
{l.name} - {l.external && } + {l.external && }
; })} @@ -47,50 +46,17 @@ let links: NavBarLink[] = navBarConfig.links.map(
- {!siteConfig.themeColor.fixed && ( - - )} - +
- - -
-
-
- {i18n(I18nKey.themeColor)} - -
-
-
- {hue} -
-
-
-
- -
-
- - - diff --git a/src/components/widget/NavMenuPanel.astro b/src/components/widget/NavMenuPanel.astro index cf141e3..a28022a 100644 --- a/src/components/widget/NavMenuPanel.astro +++ b/src/components/widget/NavMenuPanel.astro @@ -19,11 +19,11 @@ const links = Astro.props.links;
{link.name}
- {!link.external && } - {link.external && } diff --git a/src/components/widget/Profile.astro b/src/components/widget/Profile.astro index 26e7dc3..6285298 100644 --- a/src/components/widget/Profile.astro +++ b/src/components/widget/Profile.astro @@ -19,7 +19,7 @@ const config = profileConfig; max-w-[12rem] lg:max-w-none overflow-hidden rounded-xl active:scale-95">
-
@@ -36,12 +36,12 @@ const config = profileConfig;
{config.links.length > 1 && config.links.map(item => - + )} {config.links.length == 1 && - + {config.links[0].name} }
@@ -51,7 +51,7 @@ const config = profileConfig;
- + 加载中...
@@ -59,7 +59,7 @@ const config = profileConfig;
- + 加载中... diff --git a/src/components/widget/ThemeSettingsBlock.svelte b/src/components/widget/ThemeSettingsBlock.svelte new file mode 100644 index 0000000..c7053c2 --- /dev/null +++ b/src/components/widget/ThemeSettingsBlock.svelte @@ -0,0 +1,349 @@ + + +
+ + +
+
+ + +
+ + {#if showThemeColor} +
+
+ {i18n(I18nKey.themeColor)} + +
+
+
+ {hue} +
+
+
+
+ +
+ {/if} + +
+
+ 字体系列 +
+ + +
+ +
+
+
+ 自定义 CSS +
+ +
+ +
+ 字体系列 会在 自定义 CSS 之后注入,所以字体设置优先级更高。 +
+
+
+
+ + diff --git a/src/components/widget/TotalWords.astro b/src/components/widget/TotalWords.astro index 03ce201..19f5213 100644 --- a/src/components/widget/TotalWords.astro +++ b/src/components/widget/TotalWords.astro @@ -1,15 +1,15 @@ --- -import { Icon } from "astro-icon/components"; import I18nKey from "@i18n/i18nKey"; import { i18n } from "@i18n/translation"; import { getTotalWords } from "@utils/content-utils"; +import { Icon } from "astro-icon/components"; const totalWords = await getTotalWords(); const formattedTotalWords = totalWords.toLocaleString("zh-CN"); ---
- + 总计 {formattedTotalWords} {i18n(I18nKey.wordsCount)}
diff --git a/src/components/widget/WidgetLayout.astro b/src/components/widget/WidgetLayout.astro index 870dcfb..3f223c5 100644 --- a/src/components/widget/WidgetLayout.astro +++ b/src/components/widget/WidgetLayout.astro @@ -24,7 +24,7 @@ const className = Astro.props.class; {isCollapsed &&
} diff --git a/src/config.ts b/src/config.ts index 53800a3..ec537fb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -11,6 +11,7 @@ import { LinkPreset } from "./types/config"; export const siteConfig: SiteConfig = { title: "Ad_closeNN 的小站", subtitle: "Ad_closeNN の 小站,时不时会刷新一些野生东西 | ✨ 欢迎友链 ✨", + githubRepo: "https://github.com/Ad-closeNN/blog-fuwari", lang: "zh_CN", // Language code, e.g. 'en', 'zh-CN', 'ja', etc. themeColor: { hue: 160, // Default hue for the theme color, from 0 to 360. e.g. red: 0, teal: 200, cyan: 250, pink: 345 diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6c9baf4..4af5b1a 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -276,7 +276,7 @@ const bannerOffset =