From b8b0c8fa63f1ea686cc345b04c5157dad8b41d2e Mon Sep 17 00:00:00 2001 From: GyDi Date: Sat, 19 Mar 2022 15:35:59 +0800 Subject: [PATCH] fix: adjust windows style --- src/assets/styles/layout.scss | 6 +++--- src/pages/_layout.tsx | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/assets/styles/layout.scss b/src/assets/styles/layout.scss index e75887f..171a78c 100644 --- a/src/assets/styles/layout.scss +++ b/src/assets/styles/layout.scss @@ -72,7 +72,7 @@ .the-content { position: absolute; - top: 30px; + top: 0; left: 0; right: 2px; bottom: 10px; @@ -80,8 +80,8 @@ } } -.macos.layout { +.windows.layout { .layout__right .the-content { - top: 0; + top: 30px; } } diff --git a/src/pages/_layout.tsx b/src/pages/_layout.tsx index b82c3d3..43bad1c 100644 --- a/src/pages/_layout.tsx +++ b/src/pages/_layout.tsx @@ -19,7 +19,8 @@ import UpdateButton from "../components/layout/update-button"; import "dayjs/locale/zh-cn"; dayjs.extend(relativeTime); -const isMacos = navigator.userAgent.includes("Mac OS X"); + +const isWinOs = /win64|win32/i.test(navigator.userAgent); const Layout = () => { const { t } = useTranslation(); @@ -81,7 +82,7 @@ const Layout = () => { ({ @@ -110,7 +111,7 @@ const Layout = () => {
- {!isMacos && ( + {isWinOs && (