From 5cf401657ce1e91920f1572c85e5d850cb93d9ec Mon Sep 17 00:00:00 2001 From: xunbu Date: Tue, 15 Jul 2025 17:39:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=80=82=E9=85=8Dv1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docutranslate/__init__.py | 2 +- docutranslate/static/index.html | 376 +++++++++++++++++------------- docutranslate/static/split.min.js | 3 + 3 files changed, 219 insertions(+), 162 deletions(-) create mode 100644 docutranslate/static/split.min.js diff --git a/docutranslate/__init__.py b/docutranslate/__init__.py index 17be052..362b205 100644 --- a/docutranslate/__init__.py +++ b/docutranslate/__init__.py @@ -1,4 +1,4 @@ -__version__="0.3.1" +__version__="0.3.2b1" diff --git a/docutranslate/static/index.html b/docutranslate/static/index.html index 7b20238..e97aa28 100644 --- a/docutranslate/static/index.html +++ b/docutranslate/static/index.html @@ -16,45 +16,30 @@ background-color: var(--bs-body-bg); } - /* --- 响应式布局修改 --- */ - - /* 桌面端 (lg及以上): 保持左右分栏固定高度布局 */ - @media (min-width: 992px) { - .main-container { - display: flex; - flex-direction: column; - height: 100vh; - padding-top: 1rem; - padding-bottom: 1rem; - } - - .settings-panel, .task-area { - height: calc(100vh - 2rem); - overflow-y: auto; - } - - .settings-panel { - padding-right: 15px; /* for scrollbar */ - } + .main-container { + display: flex; + flex-direction: column; + height: 100vh; + padding-top: 1rem; + padding-bottom: 1rem; } - /* 移动端 (lg以下): 布局变为自然文档流,可滚动 */ - @media (max-width: 991.98px) { - .main-container { - padding-top: 1rem; - padding-bottom: 1rem; - } - .settings-panel { - margin-bottom: 2rem; /* 在移动端堆叠时增加间距 */ - } + .settings-panel { + height: calc(100vh - 2rem); + overflow-y: auto; + padding-right: 15px; /* for scrollbar */ } - /* --- 结束响应式布局修改 --- */ + .task-area { + height: calc(100vh - 2rem); + overflow-y: auto; + } .task-card { transition: all 0.3s ease-in-out; } + /* === 修改点: 为等待ID的状态添加样式 === */ .task-id-placeholder { color: var(--bs-secondary-color); font-style: italic; @@ -103,13 +88,11 @@ font-weight: bold; } - #printFrame { + #printFrame, #translatedPreviewFrame { border: none; width: 100%; - display: none; /* 保持隐藏 */ } - /* --- 预览侧边栏样式 --- */ #previewOffcanvas { --bs-offcanvas-width: 95vw; max-width: 1600px; @@ -117,14 +100,14 @@ .preview-split-container { display: flex; - flex-direction: row; /* 桌面端默认为行 */ + flex-direction: row; height: 100%; } .preview-pane-wrapper { display: flex; flex-direction: column; - overflow: hidden; /* 对Split.js很重要 */ + overflow: hidden; /* Important for split.js */ } .preview-pane-wrapper h6 { @@ -133,42 +116,35 @@ } .preview-pane-wrapper .preview-pane { - flex-grow: 1; + flex-grow: 1; /* Make the inner pane grow */ border: 1px solid var(--bs-border-color); border-radius: .375rem; - overflow: auto; + overflow: auto; } + /* MODIFIED: Redefined gutter styles for both directions */ .gutter { background-color: var(--bs-tertiary-bg); background-repeat: no-repeat; background-position: 50%; } + .gutter.gutter-horizontal { cursor: col-resize; border-left: 1px solid var(--bs-border-color); border-right: 1px solid var(--bs-border-color); } + .gutter.gutter-vertical { cursor: row-resize; border-top: 1px solid var(--bs-border-color); border-bottom: 1px solid var(--bs-border-color); } - /* 移动端预览: 上下分栏 */ - @media (max-width: 767.98px) { - .preview-split-container { - flex-direction: column; - } - .preview-pane-wrapper { - /* 当Split.js不活动时,让每个面板占据一半高度 */ - height: 50%; - } - } .preview-pane iframe, .preview-pane pre { width: 100%; - height: 100%; /* 占满其容器 */ + height: 95%; border: none; margin: 0; padding: 0; @@ -186,6 +162,40 @@ left: 1rem; z-index: 1050; } + + /* === MODIFIED: Added Responsive Styles === */ + + /* Make the main layout responsive for mobile (stacks below lg breakpoint) */ + @media (max-width: 991.98px) { + .main-container { + height: auto; /* Allow natural page height */ + padding-bottom: 6rem; /* Add padding at the bottom for floating theme switch */ + } + + .settings-panel, .task-area { + height: auto; /* Remove fixed height to allow natural flow */ + overflow-y: visible; + } + + .settings-panel { + padding-right: 0; /* No scrollbar space needed */ + margin-bottom: 2rem; /* Add space when panels stack */ + } + } + + /* Adjustments for smaller screens (tablets and phones) */ + @media (max-width: 767.98px) { + /* Add space between file area and log area when they stack on mobile */ + .task-card .col-md-7 { + margin-top: 1.5rem; + } + + /* Make preview offcanvas full width on mobile */ + #previewOffcanvas { + --bs-offcanvas-width: 100vw; + } + } + @@ -196,7 +206,7 @@
-

DocuTranslate

+

Docutranslate

@@ -208,7 +218,7 @@

@@ -238,7 +248,7 @@

@@ -287,7 +297,7 @@
@@ -337,7 +347,7 @@
@@ -385,9 +395,9 @@ -
+

- 项目主页 (欢迎star❤):
+ 项目主页(欢迎star❤):
https://github.com/xunbu/docutranslate

@@ -422,6 +432,7 @@ - +

预览
@@ -509,7 +520,7 @@
-