From 51d3e093781973b1cbd695aad71b87ae0839948e Mon Sep 17 00:00:00 2001 From: hz4th_coder Date: Wed, 19 Aug 2026 12:50:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AF=BC=E5=87=BA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=B1=95=E5=BC=80/=E6=8A=98=E5=8F=A0?= =?UTF-8?q?=EF=BC=88=E9=BB=98=E8=AE=A4=E6=8A=98=E5=8F=A0=EF=BC=89+=20?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E9=BB=98=E8=AE=A4=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 导出设置面板默认折叠,点击标题栏展开/收起,折叠栏显示当前分辨率摘要 - 折叠栏保留快速下载按钮,始终可用 - 新增🔄恢复默认按钮:一键重置分辨率/自定义/文件名/历史选择到初始状态(历史记录保留) --- app.js | 29 +++++++++++++++++--- index.html | 79 ++++++++++++++++++++++++++++++------------------------ style.css | 51 +++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 38 deletions(-) diff --git a/app.js b/app.js index 24f41b5..1a1c63d 100644 --- a/app.js +++ b/app.js @@ -648,6 +648,28 @@ function onExportPresetChange() { refreshPreview(); } +// 导出设置面板展开/折叠(默认折叠) +let exportSettingsOpen = false; +function toggleExportSettings() { + exportSettingsOpen = !exportSettingsOpen; + const body = document.getElementById('exportSettingsBody'); + const t = document.getElementById('exportToggle'); + body.style.display = exportSettingsOpen ? 'block' : 'none'; + t.textContent = exportSettingsOpen ? '▾' : '▸'; +} + +// 一键恢复默认(重置全部设置,历史记录保留) +function resetExportSettings() { + document.getElementById('exportPreset').value = 'original'; + document.getElementById('customResGroup').style.display = 'none'; + document.getElementById('customWidth').value = ''; + document.getElementById('customHeight').value = ''; + document.getElementById('exportFilename').value = ''; + document.getElementById('exportHistory').value = ''; + refreshExportHint(); + refreshPreview(); +} + function onCustomResInput() { refreshExportHint(); refreshPreview(); @@ -778,12 +800,13 @@ function exportCurrent(prefix) { }).catch(err => alert(err.message)); } -// 导出分辨率提示 +// 导出分辨率提示 + 折叠栏摘要 function refreshExportHint() { const { w, h } = getResolution(); const hint = document.getElementById('exportResHint'); - if (!hint) return; - hint.textContent = w > 0 && h > 0 ? `导出分辨率:${w} × ${h}(原图居中缩放)` : '导出分辨率:原始大小'; + if (hint) hint.textContent = w > 0 && h > 0 ? `导出分辨率:${w} × ${h}(原图居中缩放)` : '导出分辨率:原始大小'; + const sum = document.getElementById('exportSummary'); + if (sum) sum.textContent = w > 0 && h > 0 ? `${w} × ${h}` : '原始大小'; } // 刷新导出预览:以原图为中心,居中展示保存后的图 diff --git a/index.html b/index.html index e520699..5b1e549 100644 --- a/index.html +++ b/index.html @@ -208,47 +208,56 @@ C, 20, 30, 40 - +
-

📤 导出设置

- -
- - -
- -