From 47f5ef220c22f6c7c2303cd530a8afad29d81733 Mon Sep 17 00:00:00 2001
From: icefire <1028247921@qq.com>
Date: Mon, 21 Oct 2024 21:33:21 +0800
Subject: [PATCH] =?UTF-8?q?update:=E9=80=82=E9=85=8D=E7=A7=BB=E5=8A=A8?=
=?UTF-8?q?=E7=AB=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/[[...lang]]/components/form.tsx | 3 +--
src/app/components/header.tsx | 6 ++++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/app/[[...lang]]/components/form.tsx b/src/app/[[...lang]]/components/form.tsx
index b292f84..bdaa395 100644
--- a/src/app/[[...lang]]/components/form.tsx
+++ b/src/app/[[...lang]]/components/form.tsx
@@ -26,9 +26,8 @@ export default function Form() {
>
提交
diff --git a/src/app/components/header.tsx b/src/app/components/header.tsx
index 370f768..8a3d83b 100644
--- a/src/app/components/header.tsx
+++ b/src/app/components/header.tsx
@@ -18,11 +18,13 @@ export default function Header(props: { dict: Record, lang: stri
const [hash, setHash] = useState('#home')
useEffect(() => {
const designWidth = 1440;
- const deviceWidth = window.innerWidth;
+ const deviceWidth = document.documentElement.clientWidth
let scale = 1
+ console.log('designWidth', deviceWidth)
if (deviceWidth <= 1440) {
scale = deviceWidth / designWidth;
}
+ console.log('scale', scale)
document.documentElement.style.fontSize = `${scale * 14.4}px`;
switch (hash) {
case '#home':
@@ -127,7 +129,7 @@ export default function Header(props: { dict: Record, lang: stri