diff --git a/web/pixiv_dialog.css b/web/pixiv_dialog.css index 625e1a5..21a19bc 100644 --- a/web/pixiv_dialog.css +++ b/web/pixiv_dialog.css @@ -168,6 +168,38 @@ text-overflow: ellipsis; } +#pixiv-clear-all-btn { + padding: 4px 10px; + background: transparent; + border: 1px solid #45475a; + color: #7f849c; + border-radius: 4px; + cursor: pointer; + font-size: 12px; +} +#pixiv-clear-all-btn:hover { color: #f38ba8; border-color: #f38ba8; } + +.pixiv-card-remove-btn { + position: absolute; + top: 4px; + right: 4px; + background: rgba(243, 139, 168, 0.85); + color: #1e1e2e; + border: none; + border-radius: 50%; + width: 20px; + height: 20px; + display: flex; + align-items: center; + justify-content: center; + font-size: 11px; + font-weight: bold; + cursor: pointer; + line-height: 1; + padding: 0; +} +.pixiv-card-remove-btn:hover { background: #f38ba8; } + .pixiv-seq-badge { position: absolute; top: 4px; diff --git a/web/pixiv_extension.js b/web/pixiv_extension.js index 5873bb9..da092c7 100644 --- a/web/pixiv_extension.js +++ b/web/pixiv_extension.js @@ -11,6 +11,9 @@ const state = { artistNextUrl: null, }; +// Persists across modal opens so the "已选" panel can show thumbnails +const illustCache = new Map(); + // ── CSS injection ───────────────────────────────────────────────────────────── function injectCSS() { @@ -34,6 +37,9 @@ function escapeHtml(str) { function updateSelectedCount() { const el = document.getElementById("pixiv-selected-count"); if (el) el.textContent = `已选 ${state.selectedIds.length} 张`; + const tabEl = document.getElementById("pixiv-selected-tab"); + if (tabEl) tabEl.textContent = state.selectedIds.length > 0 + ? `已选 (${state.selectedIds.length})` : "已选"; } // ── Modal DOM ───────────────────────────────────────────────────────────────── @@ -46,6 +52,7 @@ function buildModal() {