feat(前端界面): 统一DPI选项与显示样式
build.yaml / build (push) Successful in 42s

This commit is contained in:
xiaoqidun committed 2026-10-18 02:40:02 +08:00
1 parent 7126568b47
commit a665d5c11b
3 files changed
+23 -10

No files matched your search

+5 -5
View File
@@ -55,10 +55,10 @@
<div class="tool-group"> <div class="tool-group">
<label class="toolbar-select"><select id="exportFormat" class="format-select" title="导出格式" disabled></select><span id="formatValue"></span></label> <label class="toolbar-select"><select id="exportFormat" class="format-select" title="导出格式" disabled></select><span id="formatValue"></span></label>
<label class="toolbar-select"><select id="imageDPI" class="format-select" title="输出精度" disabled> <label class="toolbar-select"><select id="imageDPI" class="format-select" title="输出精度" disabled>
<option value="96">96 dpi</option> <option value="96">96 DPI</option>
<option value="150">150 dpi</option> <option value="150">150 DPI</option>
<option value="300" selected>300 dpi</option> <option value="300" selected>300 DPI</option>
<option value="600">600 dpi</option> <option value="600">600 DPI</option>
</select><span id="dpiValue">300</span></label> </select><span id="dpiValue">300</span></label>
<label class="toolbar-select"><select id="outputCompression" class="format-select" title="压缩模式" disabled><option value="0">原始</option><option value="1">无损</option><option value="2">轻压</option><option value="3">均衡</option><option value="4">强压</option></select><span id="compressionValue" data-short="原">原始</span></label> <label class="toolbar-select"><select id="outputCompression" class="format-select" title="压缩模式" disabled><option value="0">原始</option><option value="1">无损</option><option value="2">轻压</option><option value="3">均衡</option><option value="4">强压</option></select><span id="compressionValue" data-short="原">原始</span></label>
<button id="exportPageButton" class="button" type="button" data-short="单" disabled>单页</button> <button id="exportPageButton" class="button" type="button" data-short="单" disabled>单页</button>
@@ -205,7 +205,7 @@
<div class="form-row"><label for="convertFormat">格式</label><select id="convertFormat" required></select></div> <div class="form-row"><label for="convertFormat">格式</label><select id="convertFormat" required></select></div>
<div class="form-row"><label for="convertCompression">压缩</label><select id="convertCompression"><option value="0">原始</option><option value="1">无损</option><option value="2">轻压</option><option value="3">均衡</option><option value="4">强压</option></select></div> <div class="form-row"><label for="convertCompression">压缩</label><select id="convertCompression"><option value="0">原始</option><option value="1">无损</option><option value="2">轻压</option><option value="3">均衡</option><option value="4">强压</option></select></div>
<div id="convertFontRow" class="form-row" hidden><label for="convertFontMode">字体</label><select id="convertFontMode"><option value="0">保持</option><option value="1">内嵌</option><option value="2">外部</option></select></div> <div id="convertFontRow" class="form-row" hidden><label for="convertFontMode">字体</label><select id="convertFontMode"><option value="0">保持</option><option value="1">内嵌</option><option value="2">外部</option></select></div>
<div id="convertDPIRow" class="form-row" hidden><label for="convertDPI">精度</label><select id="convertDPI"><option value="96">96 dpi</option><option value="150">150 dpi</option><option value="300" selected>300 dpi</option><option value="600">600 dpi</option></select></div> <div id="convertDPIRow" class="form-row" hidden><label for="convertDPI">精度</label><div class="form-select"><select id="convertDPI"><option value="96">96 DPI</option><option value="150">150 DPI</option><option value="300" selected>300 DPI</option><option value="600">600 DPI</option></select><span id="convertDPIValue">300</span></div></div>
<div class="form-row"><label for="convertDestination">保存</label><select id="convertDestination"><option value="directory">目录</option><option value="archive">打包</option></select></div> <div class="form-row"><label for="convertDestination">保存</label><select id="convertDestination"><option value="directory">目录</option><option value="archive">打包</option></select></div>
<div class="form-row"><label for="convertParallel">并行</label><input id="convertParallel" type="number" min="1" step="1" placeholder="自动"></div> <div class="form-row"><label for="convertParallel">并行</label><input id="convertParallel" type="number" min="1" step="1" placeholder="自动"></div>
</div> </div>
+16 -5
View File
@@ -678,7 +678,8 @@ button:not(:disabled):hover {
color: #1f2428; color: #1f2428;
} }
.toolbar-select { .toolbar-select,
.form-select {
position: relative; position: relative;
display: inline-flex; display: inline-flex;
} }
@@ -690,11 +691,13 @@ button:not(:disabled):hover {
color: transparent; color: transparent;
} }
.toolbar-select option { .toolbar-select option,
.form-select option {
color: #1f2428; color: #1f2428;
} }
.toolbar-select > span { .toolbar-select > span,
.form-select > span {
position: absolute; position: absolute;
inset: 0; inset: 0;
display: flex; display: flex;
@@ -705,7 +708,8 @@ button:not(:disabled):hover {
pointer-events: none; pointer-events: none;
} }
.toolbar-select::after { .toolbar-select::after,
.form-select::after {
position: absolute; position: absolute;
right: 7px; right: 7px;
top: calc(50% - 2px); top: calc(50% - 2px);
@@ -717,7 +721,9 @@ button:not(:disabled):hover {
} }
.toolbar-select select:disabled + span, .toolbar-select select:disabled + span,
.toolbar-select:has(select:disabled)::after { .toolbar-select:has(select:disabled)::after,
.form-select select:disabled + span,
.form-select:has(select:disabled)::after {
opacity: 0.48; opacity: 0.48;
} }
@@ -1267,6 +1273,11 @@ button:not(:disabled):hover {
color: #1f2428; color: #1f2428;
} }
.form-row .form-select select {
appearance: none;
color: transparent;
}
.form-row textarea { .form-row textarea {
height: auto; height: auto;
min-height: var(--control-height); min-height: var(--control-height);
+2
View File
@@ -1387,6 +1387,7 @@ batchElements.Add.addEventListener("click", () => batchElements.Input.click());
batchElements.Input.addEventListener("change", () => { addBatchFiles(batchElements.Input.files); batchElements.Input.value = ""; }); batchElements.Input.addEventListener("change", () => { addBatchFiles(batchElements.Input.files); batchElements.Input.value = ""; });
batchElements.Clear.addEventListener("click", () => { batch.items = []; renderBatchList(); batchElements.Status.textContent = ""; batchElements.Progress.value = 0; }); batchElements.Clear.addEventListener("click", () => { batch.items = []; renderBatchList(); batchElements.Status.textContent = ""; batchElements.Progress.value = 0; });
batchElements.Format.addEventListener("change", updateBatchControls); batchElements.Format.addEventListener("change", updateBatchControls);
batchElements.DPI.addEventListener("change", updateBatchControls);
batchElements.Close.addEventListener("click", () => batchElements.Panel.close()); batchElements.Close.addEventListener("click", () => batchElements.Panel.close());
batchElements.Cancel.addEventListener("click", cancelBatch); batchElements.Cancel.addEventListener("click", cancelBatch);
batchElements.Form.addEventListener("submit", event => { event.preventDefault(); runBatch(); }); batchElements.Form.addEventListener("submit", event => { event.preventDefault(); runBatch(); });
@@ -8239,6 +8240,7 @@ function updateBatchControls() {
batchElements.Close.textContent = batch.running ? "收起" : "关闭"; batchElements.Close.textContent = batch.running ? "收起" : "关闭";
batchElements.Count.textContent = batch.items.length ? `${batch.items.length}个文件` : ""; batchElements.Count.textContent = batch.items.length ? `${batch.items.length}个文件` : "";
batchElements.DPIRow.hidden = !(batch.items.length ? batch.items : [null]).some(batchUsesDPI); batchElements.DPIRow.hidden = !(batch.items.length ? batch.items : [null]).some(batchUsesDPI);
batchElements.DPI.nextElementSibling.textContent = batchElements.DPI.value;
batchElements.Button.toggleAttribute("data-running", batch.running); batchElements.Button.toggleAttribute("data-running", batch.running);
} }