From a1dc5cae4c11655fc3bef3f4d270f4491820967c Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Mon, 5 Aug 2024 16:48:27 +0800 Subject: [PATCH] adjust the light mode style --- .../src/components/base/border-swtich.tsx | 2 +- .../src/components/profiles/profile-item.tsx | 20 ++++++++++++---- .../src/components/sider/conn-card.tsx | 11 ++++++--- .../src/components/sider/log-card.tsx | 9 ++++++-- .../components/sider/mihomo-core-card.tsx.tsx | 14 +++++++---- .../src/components/sider/override-card.tsx | 9 ++++++-- .../src/components/sider/profile-card.tsx | 11 +++++---- .../src/components/sider/proxy-card.tsx | 12 ++++++---- .../src/components/sider/rule-card.tsx | 13 +++++++---- .../components/sider/sysproxy-switcher.tsx | 8 +++++-- .../src/components/sider/test-card.tsx | 9 ++++++-- .../src/components/sider/tun-switcher.tsx | 10 ++++++-- tailwind.config.js | 23 +------------------ 13 files changed, 92 insertions(+), 59 deletions(-) diff --git a/src/renderer/src/components/base/border-swtich.tsx b/src/renderer/src/components/base/border-swtich.tsx index 437bce5..16ba858 100644 --- a/src/renderer/src/components/base/border-swtich.tsx +++ b/src/renderer/src/components/base/border-swtich.tsx @@ -13,7 +13,7 @@ const BorderSwitch: React.FC = (props) => { classNames={{ wrapper: cn('border-2', { 'border-transparent': !isShowBorder, - 'border-foreground': isShowBorder + 'border-white': isShowBorder }), thumb: cn('absolute z-4', 'transform -translate-x-[2px]'), ...classNames diff --git a/src/renderer/src/components/profiles/profile-item.tsx b/src/renderer/src/components/profiles/profile-item.tsx index abd0d6e..dc97bf6 100644 --- a/src/renderer/src/components/profiles/profile-item.tsx +++ b/src/renderer/src/components/profiles/profile-item.tsx @@ -122,7 +122,9 @@ const ProfileItem: React.FC = (props) => {
-

+

{info?.name}

@@ -141,13 +143,16 @@ const ProfileItem: React.FC = (props) => { > @@ -165,7 +170,9 @@ const ProfileItem: React.FC = (props) => {
-
+
{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined} {dayjs(info.updated).fromNow()}
@@ -174,7 +181,10 @@ const ProfileItem: React.FC = (props) => { {extra && ( )} diff --git a/src/renderer/src/components/sider/conn-card.tsx b/src/renderer/src/components/sider/conn-card.tsx index e8870c3..a02def3 100644 --- a/src/renderer/src/components/sider/conn-card.tsx +++ b/src/renderer/src/components/sider/conn-card.tsx @@ -38,9 +38,12 @@ const ConnCard: React.FC = () => { variant="flat" color="default" > - + -
+
{calcTraffic(upload)}/s
@@ -53,7 +56,9 @@ const ConnCard: React.FC = () => {
-

连接

+

+ 连接 +

) diff --git a/src/renderer/src/components/sider/log-card.tsx b/src/renderer/src/components/sider/log-card.tsx index 22bca6c..552a502 100644 --- a/src/renderer/src/components/sider/log-card.tsx +++ b/src/renderer/src/components/sider/log-card.tsx @@ -20,12 +20,17 @@ const LogCard: React.FC = () => { variant="flat" color="default" > - +
-

日志

+

+ 日志 +

) diff --git a/src/renderer/src/components/sider/mihomo-core-card.tsx.tsx b/src/renderer/src/components/sider/mihomo-core-card.tsx.tsx index f440ac3..a4d01ae 100644 --- a/src/renderer/src/components/sider/mihomo-core-card.tsx.tsx +++ b/src/renderer/src/components/sider/mihomo-core-card.tsx.tsx @@ -39,7 +39,9 @@ const MihomoCoreCard: React.FC = () => { >
-

+

{version?.version ?? '-'}

@@ -52,14 +54,16 @@ const MihomoCoreCard: React.FC = () => { restartCore() }} > - +
-
-

内核设置

-

{calcTraffic(mem)}

+
+

内核设置

+

{calcTraffic(mem)}

diff --git a/src/renderer/src/components/sider/override-card.tsx b/src/renderer/src/components/sider/override-card.tsx index ac6e286..3ecb734 100644 --- a/src/renderer/src/components/sider/override-card.tsx +++ b/src/renderer/src/components/sider/override-card.tsx @@ -24,7 +24,10 @@ const OverrideCard: React.FC = () => { variant="flat" color="default" > - + {
-

覆写

+

+ 覆写 +

) diff --git a/src/renderer/src/components/sider/profile-card.tsx b/src/renderer/src/components/sider/profile-card.tsx index e3393e6..4da7926 100644 --- a/src/renderer/src/components/sider/profile-card.tsx +++ b/src/renderer/src/components/sider/profile-card.tsx @@ -37,7 +37,9 @@ const ProfileCard: React.FC = () => { >
-

+

{info?.name}

-
+
{extra ? `${calcTraffic(usage)}/${calcTraffic(total)}` : undefined} {dayjs(info.updated).fromNow()}
@@ -68,7 +69,7 @@ const ProfileCard: React.FC = () => { {extra && ( )} diff --git a/src/renderer/src/components/sider/proxy-card.tsx b/src/renderer/src/components/sider/proxy-card.tsx index d4ef4bb..496dcc9 100644 --- a/src/renderer/src/components/sider/proxy-card.tsx +++ b/src/renderer/src/components/sider/proxy-card.tsx @@ -24,14 +24,16 @@ const ProxyCard: React.FC = () => { variant="flat" color="default" > - + {
-

代理组

+

+ 代理组 +

) diff --git a/src/renderer/src/components/sider/rule-card.tsx b/src/renderer/src/components/sider/rule-card.tsx index 2dd58bb..a74b7ae 100644 --- a/src/renderer/src/components/sider/rule-card.tsx +++ b/src/renderer/src/components/sider/rule-card.tsx @@ -26,14 +26,17 @@ const RuleCard: React.FC = () => { variant="flat" color="default" > - + {
-

规则

+

+ 规则 +

) diff --git a/src/renderer/src/components/sider/sysproxy-switcher.tsx b/src/renderer/src/components/sider/sysproxy-switcher.tsx index 2865760..faca5ac 100644 --- a/src/renderer/src/components/sider/sysproxy-switcher.tsx +++ b/src/renderer/src/components/sider/sysproxy-switcher.tsx @@ -37,7 +37,9 @@ const SysproxySwitcher: React.FC = () => { variant="flat" color="default" > - + {
-

系统代理

+

+ 系统代理 +

) diff --git a/src/renderer/src/components/sider/test-card.tsx b/src/renderer/src/components/sider/test-card.tsx index 540a991..b0e3928 100644 --- a/src/renderer/src/components/sider/test-card.tsx +++ b/src/renderer/src/components/sider/test-card.tsx @@ -22,12 +22,17 @@ const TestCard: React.FC = () => { variant="flat" color="default" > - + -

测试

+

+ 测试 +

) diff --git a/src/renderer/src/components/sider/tun-switcher.tsx b/src/renderer/src/components/sider/tun-switcher.tsx index e008990..5fdd01b 100644 --- a/src/renderer/src/components/sider/tun-switcher.tsx +++ b/src/renderer/src/components/sider/tun-switcher.tsx @@ -60,7 +60,9 @@ const TunSwitcher: React.FC = () => { variant="flat" color="default" > - + { -

虚拟网卡

+

+ 虚拟网卡 +

diff --git a/tailwind.config.js b/tailwind.config.js index 7859875..ac1ec3b 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -10,26 +10,5 @@ module.exports = { extend: {} }, darkMode: 'class', - plugins: [ - nextui({ - themes: { - dark: { - colors: { - primary: { - DEFAULT: '#006FEE', - foreground: '#FFFFFF' - } - } - }, - light: { - colors: { - primary: { - DEFAULT: '#41C3F8', - foreground: '#000000' - } - } - } - } - }) - ] + plugins: [nextui()] }