Skip to content

Commit bccfd0d

Browse files
fix: align IMAP mail list row style with main site card layout
1 parent 5bd8e8a commit bccfd0d

File tree

1 file changed

+61
-40
lines changed

1 file changed

+61
-40
lines changed

mail-viewer/imap-mail-app/public/index.html

Lines changed: 61 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -234,58 +234,86 @@
234234
border-right: 1px solid var(--embed-border);
235235
background: transparent;
236236
flex-shrink: 0;
237+
padding-top: 8px;
237238
}
238239

239240
.mail-row {
240-
padding: 12px 16px;
241-
border-bottom: 1px solid rgba(212,228,222,0.8);
241+
padding: 10px 14px;
242+
margin: 0 8px 8px;
243+
border: 1px solid var(--embed-border);
244+
border-radius: var(--embed-radius-sm);
242245
cursor: pointer;
243246
display: flex;
244-
gap: 12px;
247+
gap: 10px;
245248
transition: all 0.15s ease;
246249
position: relative;
247250
align-items: flex-start;
251+
background: var(--embed-surface);
248252
}
249253

250-
.mail-row:hover { background: #edf5f2; }
254+
.mail-row:hover { background: rgba(91,154,139,0.08); }
251255
.mail-row.active {
252-
background: #e7f2ee;
253-
box-shadow: inset 0 0 0 1px rgba(91,154,139,0.12);
256+
background: rgba(91,154,139,0.15);
257+
border-left: 3px solid var(--embed-primary);
254258
}
255-
.mail-row.unread { font-weight: 600; border-left: 3px solid var(--embed-primary); padding-left: 13px; }
256-
257-
.mail-row .dot {
258-
width: 8px;
259-
min-width: 8px;
260-
height: 8px;
261-
border-radius: 50%;
262-
margin-top: 5px;
259+
.mail-row.unread {
260+
border-left: 3px solid var(--embed-navy);
261+
background: rgba(74,124,155,0.06);
262+
}
263+
.mail-row.unread .mail-from {
264+
font-weight: 700;
265+
color: var(--embed-text);
266+
}
267+
.mail-row.unread .mail-subject {
268+
font-weight: 600;
269+
color: var(--embed-text);
270+
}
271+
.mail-row:not(.unread) .mail-from {
272+
font-weight: 400;
273+
color: var(--embed-muted);
274+
}
275+
.mail-row:not(.unread) .mail-subject {
276+
font-weight: 400;
277+
color: var(--embed-muted);
278+
}
279+
.mail-row.active .mail-from,
280+
.mail-row.active .mail-subject {
281+
font-weight: 700;
282+
color: var(--embed-text);
263283
}
264-
265-
.mail-row.unread .dot { background: var(--embed-primary); }
266284

267285
.mail-col { min-width: 0; flex: 1; }
268286

269-
.mail-from, .mail-subject {
287+
.mail-row-top {
288+
display: flex;
289+
justify-content: space-between;
290+
align-items: baseline;
291+
gap: 8px;
292+
margin-bottom: 2px;
293+
}
294+
295+
.mail-from {
270296
font-size: 14px;
271297
overflow: hidden;
272298
text-overflow: ellipsis;
273299
white-space: nowrap;
300+
flex: 1;
301+
min-width: 0;
274302
}
275303

276-
.mail-from {
277-
color: var(--embed-muted);
278-
margin-bottom: 2px;
304+
.mail-subject {
305+
font-size: 14px;
306+
overflow: hidden;
307+
text-overflow: ellipsis;
308+
white-space: nowrap;
279309
}
280310

281-
.mail-subject { color: var(--embed-text); }
282-
283311
.mail-date {
284-
font-size: 13px;
312+
font-size: 12px;
285313
color: var(--embed-muted);
286314
white-space: nowrap;
287-
min-width: 80px;
288-
text-align: right;
315+
flex-shrink: 0;
316+
opacity: 0.72;
289317
}
290318

291319
.mail-detail {
@@ -480,8 +508,8 @@
480508
font-size: 14px;
481509
color: var(--embed-border);
482510
transition: color 0.15s ease;
483-
margin-right: 4px;
484511
flex-shrink: 0;
512+
margin-top: 2px;
485513
}
486514

487515
.mail-star:hover { color: #e8a73d; }
@@ -825,7 +853,8 @@
825853
}
826854

827855
.mail-row {
828-
padding: 12px;
856+
padding: 10px 12px;
857+
margin: 0 6px 6px;
829858
}
830859

831860
.mail-from,
@@ -834,10 +863,6 @@
834863
line-height: 1.5;
835864
}
836865

837-
.mail-date {
838-
min-width: auto;
839-
}
840-
841866
.detail-back {
842867
display: inline-flex;
843868
align-items: center;
@@ -1520,13 +1545,14 @@ <h3 data-i18n="modalTitle">连接 IMAP 邮箱</h3>
15201545
var starIcon = m.flagged ? '<i class="bi bi-star-fill"></i>' : '<i class="bi bi-star"></i>';
15211546
return '<div class="mail-row ' + (m.seen ? '' : 'unread') + '" onclick="readMail(' + i + ')">' +
15221547
checkbox +
1523-
'<div class="dot"></div>' +
15241548
'<span class="' + starCls + '" onclick="toggleStarInList(event, ' + i + ')" title="' + esc(t(m.flagged ? 'unstar' : 'star')) + '">' + starIcon + '</span>' +
15251549
'<div class="mail-col">' +
1526-
'<div class="mail-from">' + fromDisplay + esc(addr) + ' <span class="copy-btn" onclick="copyEmail(\'' + esc(addr) + '\', event)" title="' + esc(t('copyEmailTitle')) + '">&#x2398;</span></div>' +
1550+
'<div class="mail-row-top">' +
1551+
'<span class="mail-from">' + (m.from.name ? esc(m.from.name) : esc(addr)) + '</span>' +
1552+
'<span class="mail-date">' + date + '</span>' +
1553+
'</div>' +
15271554
'<div class="mail-subject">' + esc(m.subject) + '</div>' +
15281555
'</div>' +
1529-
'<div class="mail-date">' + date + '</div>' +
15301556
'</div>';
15311557
}).join('');
15321558
}
@@ -1981,12 +2007,7 @@ <h3 data-i18n="modalTitle">连接 IMAP 邮箱</h3>
19812007

19822008
function formatDate(d) {
19832009
if (!d) return '';
1984-
var date = new Date(d);
1985-
var now = new Date();
1986-
if (date.toDateString() === now.toDateString()) {
1987-
return date.toLocaleTimeString(currentLang === 'zh' ? 'zh-CN' : 'en-US', { hour: '2-digit', minute: '2-digit' });
1988-
}
1989-
return date.toLocaleDateString(currentLang === 'zh' ? 'zh-CN' : 'en-US', { month: '2-digit', day: '2-digit' });
2010+
return new Date(d).toLocaleString(currentLang === 'zh' ? 'zh-CN' : 'en-US');
19902011
}
19912012

19922013
// === 键盘快捷键 ===

0 commit comments

Comments
 (0)