Skip to content

Commit fe7ebdf

Browse files
Merge pull request #110 from alvin000009238/codex/reduce-header-height-for-better-ux-w2l7ar
Improve header layout and read-only share UI with status badge, responsive tweaks, and accessibility updates
2 parents 90c8d33 + d027163 commit fe7ebdf

4 files changed

Lines changed: 14 additions & 20 deletions

File tree

frontend/share.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,8 @@ export async function checkSharedLink() {
164164
if (data.success) {
165165
initDashboard(data.data);
166166

167-
document.querySelectorAll('.header-status-badge')
168-
.forEach((headerStatusBadge) => {
169-
headerStatusBadge.textContent = '僅供檢視';
170-
});
167+
const headerStatusBadge = document.getElementById('headerStatusBadge');
168+
if (headerStatusBadge) headerStatusBadge.textContent = '僅供檢視';
171169

172170
if (updateTime) updateTime.textContent = '分享存檔';
173171
} else {

frontend/styles/compatibility.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,6 @@
6666

6767

6868

69-
.share-indicator {
70-
71-
display: flex;
72-
73-
align-items: center;
74-
75-
margin-right: 12px;
76-
77-
}
78-
79-
80-
8169
/* Read Only Mode */
8270

8371
body.read-only-mode .import-dropdown,

frontend/styles/header.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,15 @@ body.read-only-mode .header-status-badge:empty {
247247

248248

249249
.time-label {
250-
display: none;
250+
position: absolute;
251+
width: 1px;
252+
height: 1px;
253+
padding: 0;
254+
margin: -1px;
255+
overflow: hidden;
256+
clip: rect(0, 0, 0, 0);
257+
white-space: nowrap;
258+
border: 0;
251259

252260
}
253261

public/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ <h2>中大壢中成績分析平台</h2>
7272
<h1>成績分析平台</h1>
7373
<div class="subtitle-row">
7474
<p class="subtitle" id="examTitle">--</p>
75-
<span class="header-status-badge" aria-live="polite"></span>
75+
<span class="header-status-badge" id="headerStatusBadge" aria-live="polite"></span>
7676
</div>
7777
</div>
7878
</div>
7979
<div class="data-time-box">
8080
<span class="header-status-badge" id="headerStatusBadge" aria-live="polite"></span>
8181
<div class="time-info">
8282

83-
<span class="time-label">資料更新時間</span>
84-
<span class="time-value" id="updateTime">--</span>
83+
<span class="time-label" id="updateTimeLabel">資料更新時間</span>
84+
<span class="time-value" id="updateTime" aria-labelledby="updateTimeLabel">--</span>
8585
</div>
8686
<div class="flex-center-gap-8 header-actions">
8787
<button class="icon-btn theme-toggle-btn" id="themeToggleBtn" type="button" aria-label="切換至淺色模式"

0 commit comments

Comments
 (0)