diff --git a/frontend/share.js b/frontend/share.js index 51422e2..77347ef 100644 --- a/frontend/share.js +++ b/frontend/share.js @@ -164,14 +164,8 @@ export async function checkSharedLink() { if (data.success) { initDashboard(data.data); - // Add header indicator - const header = document.querySelector('.header-content'); - const indicator = document.createElement('div'); - indicator.className = 'share-indicator'; - indicator.innerHTML = '僅供檢視 (唯讀)'; - // Insert before data-time-box - const timeBox = document.querySelector('.data-time-box'); - header.insertBefore(indicator, timeBox); + const headerStatusBadge = document.getElementById('headerStatusBadge'); + if (headerStatusBadge) headerStatusBadge.textContent = '僅供檢視'; if (updateTime) updateTime.textContent = '分享存檔'; } else { diff --git a/frontend/styles/compatibility.css b/frontend/styles/compatibility.css index eb0cfb3..8143cea 100644 --- a/frontend/styles/compatibility.css +++ b/frontend/styles/compatibility.css @@ -80,8 +80,6 @@ /* Read Only Mode */ -body.read-only-mode .time-info, - body.read-only-mode .import-dropdown, body.read-only-mode #shareBtn, @@ -103,4 +101,3 @@ body.read-only-mode .header { } - diff --git a/frontend/styles/header.css b/frontend/styles/header.css index 584b62a..3b96b45 100644 --- a/frontend/styles/header.css +++ b/frontend/styles/header.css @@ -182,6 +182,25 @@ } +.header-status-badge { + display: none; + align-items: center; + min-height: 24px; + padding: 2px 8px; + border: 1px solid var(--color-warning-muted); + border-radius: var(--radius-pill); + color: var(--color-warning); + background: color-mix(in srgb, var(--color-warning-muted) 60%, transparent); + font-size: 11px; + font-weight: 500; + line-height: 1.2; + white-space: nowrap; +} + +body.read-only-mode .header-status-badge { + display: inline-flex; +} + .header-actions { justify-content: flex-end; flex-wrap: nowrap; diff --git a/frontend/styles/utilities.css b/frontend/styles/utilities.css index 5d6bc33..65e48be 100644 --- a/frontend/styles/utilities.css +++ b/frontend/styles/utilities.css @@ -103,5 +103,4 @@ .mb-12 { margin-bottom: 12px; } .share-input-readonly { text-align: center; font-size: 13px; color: var(--color-primary); border-color: var(--color-primary); background: var(--color-primary-muted); } .w-full-center { width: 100%; justify-content: center; } -.readonly-badge { color: var(--color-warning); font-weight: bold; padding: 4px 8px; border: 1px solid var(--color-warning); border-radius: 4px; font-size: 12px; } .mono { font-family: monospace; } diff --git a/public/index.html b/public/index.html index c273353..2acd0dd 100644 --- a/public/index.html +++ b/public/index.html @@ -40,7 +40,7 @@ - + @@ -74,6 +74,7 @@