From f3da181e0f3002631f8050e77b8c1221ff4b9a1c Mon Sep 17 00:00:00 2001 From: SMGDev Date: Wed, 29 Oct 2025 09:25:37 +0000 Subject: [PATCH] refactor: enhance mobile responsiveness and UI components across various pages --- src/assets/css/style.scss | 17 +- src/components/Panel.vue | 43 +-- src/components/PracticeLayout.vue | 19 +- src/hooks/event.ts | 247 ++++++++++++++---- src/pages/article/ArticlesPage.vue | 211 +++++++++------ src/pages/article/BookDetail.vue | 75 +++++- .../article/components/TypingArticle.vue | 110 ++++++-- src/pages/setting/SettingItem.vue | 115 +++++++- src/pages/word/DictDetail.vue | 165 +++++++++++- src/pages/word/components/Footer.vue | 5 +- src/pages/word/components/TypeWord.vue | 16 +- 11 files changed, 820 insertions(+), 203 deletions(-) diff --git a/src/assets/css/style.scss b/src/assets/css/style.scss index 5fa5b8b2..760c157d 100644 --- a/src/assets/css/style.scss +++ b/src/assets/css/style.scss @@ -463,9 +463,16 @@ a { #typing-listener { position: fixed; - right: 0; - bottom: 0; - z-index: 9999; - height: 3rem; - // display: none !important; + left: -9999px; + top: -9999px; + width: 1px; + height: 1px; + opacity: 0.01; + z-index: -1; + pointer-events: none; + border: none; + outline: none; + background: transparent; + font-size: 16px; // 防止iOS缩放 + color: transparent; // 文字透明 } \ No newline at end of file diff --git a/src/components/Panel.vue b/src/components/Panel.vue index 4d1d1f69..142a16b6 100644 --- a/src/components/Panel.vue +++ b/src/components/Panel.vue @@ -24,7 +24,7 @@ provide('tabIndex', computed(() => tabIndex)) -
+
@@ -48,15 +48,20 @@ provide('tabIndex', computed(() => tabIndex)) .panel { width: 90vw; max-width: 400px; - max-height: 80vh; + max-height: 90vh; + height: auto; border-radius: 0.4rem; - - header { - padding: 0.5rem 0.5rem; - - .color-main { - font-size: 0.9rem; - } + } + + .panel > div.flex-1 { + max-height: calc(90vh - 3.2rem); + } + + .panel header { + padding: 0.5rem 0.5rem; + + .color-main { + font-size: 0.9rem; } } } @@ -65,14 +70,18 @@ provide('tabIndex', computed(() => tabIndex)) @media (max-width: 480px) { .panel { width: 95vw; - max-height: 85vh; - - header { - padding: 0.3rem 0.3rem; - - .color-main { - font-size: 0.8rem; - } + max-height: 94vh; + } + + .panel > div.flex-1 { + max-height: calc(94vh - 3rem); + } + + .panel header { + padding: 0.3rem 0.3rem; + + .color-main { + font-size: 0.8rem; } } } diff --git a/src/components/PracticeLayout.vue b/src/components/PracticeLayout.vue index 57e8fd15..6de234cb 100644 --- a/src/components/PracticeLayout.vue +++ b/src/components/PracticeLayout.vue @@ -13,7 +13,7 @@ defineProps<{
-
+