fix(listing): make the mobile archive reachable and clear the AA misses
Deploy / build (push) Successful in 33s
Deploy / build (push) Successful in 33s
Review pass on the 041471d delivery, measured rather than eyeballed.
/posts/ on a phone put its first archive row 2.36 screens down (featured block
1235 px + 435 px of controls = row at 1996 px at 390x844), so a reader who came
to browse had to scroll past three stacked 16:9 cards. Below 700 px the cards are
now horizontal — thumb 38 %, excerpt dropped, title clamped to three lines — and
the block header carries `All 91 posts ↓` into #archive-list (with scroll-margin
for the sticky header), which doubles as the bypass-block affordance. Block
1235 → 523 px, card 392 → 153 px, first row 1996 → 1309 px.
Two new small-text colours measured under WCAG AA (.feat-min 3.04:1,
.archive-status 3.67:1 at ~12 px) move to --muted → 5.78:1 and 6.99:1. The
featured heading went with them; pre-existing --faint dates (3.67:1) were left
alone rather than restyling 91 rows.
/categories/ still showed the old Gemini case-studies.webp while the category
page had the new topology banner — one category, two art languages. The tile now
uses case-studies-banner-1200.webp (14 KB) letterboxed on #0b1613: a 16:9 centre
crop sliced the outer host panels in half, the letterbox was measured seamless.
`6min read` was emitted without its space (template-literal fix → `6 min read`,
`6 分钟`, verified in dist/). Both /posts/ ledes stopped claiming the page is
purely newest-first.
probe-layout: 72/72 viewport checks, collapse still 425→0→425 (1280) and
523→0→523 (390) in EN and ZH.
This commit is contained in:
1 parent
050d73305d
commit
4e64bfc9ae
7 files changed
+124
-17
No files matched your search
@@ -56,6 +56,7 @@ const labels = isZh
|
||||
readArticle: '阅读文章',
|
||||
readCase: '阅读案例复盘',
|
||||
minutes: '分钟',
|
||||
skip: `全部 ${posts.length} 篇 ↓`,
|
||||
statusAll: `共 ${posts.length} 篇`,
|
||||
statusSome: `命中 {n} / ${posts.length} 篇`,
|
||||
clear: '清除筛选',
|
||||
@@ -70,6 +71,7 @@ const labels = isZh
|
||||
readArticle: 'Read article',
|
||||
readCase: 'Read case study',
|
||||
minutes: 'min read',
|
||||
skip: `All ${posts.length} posts ↓`,
|
||||
statusAll: `All ${posts.length} posts`,
|
||||
statusSome: `Showing {n} of ${posts.length} posts`,
|
||||
clear: 'Clear filters',
|
||||
@@ -131,9 +133,15 @@ const ctaLabel = (category: string) =>
|
||||
data-collapsed="false"
|
||||
>
|
||||
<div class="archive-featured-inner">
|
||||
<h2 id="archive-featured-title" class="archive-featured-title">
|
||||
<span class="af-dot" aria-hidden="true"></span>{labels.featured}
|
||||
</h2>
|
||||
<div class="af-head">
|
||||
<h2 id="archive-featured-title" class="archive-featured-title">
|
||||
<span class="af-dot" aria-hidden="true"></span>{labels.featured}
|
||||
</h2>
|
||||
{/* Jump past the cards. On a phone the block used to put the first archive
|
||||
row ~2.4 screens down, so a reader who came to browse had no way out of the
|
||||
flagships; this is also the bypass-block affordance for keyboard users. */}
|
||||
<a class="af-skip" href="#archive-list">{labels.skip}</a>
|
||||
</div>
|
||||
<div class="archive-featured-grid">
|
||||
{featured.map((f) => (
|
||||
<a class="feat-card" href={f.href}>
|
||||
@@ -157,7 +165,7 @@ const ctaLabel = (category: string) =>
|
||||
<span class="feat-title">{f.title}</span>
|
||||
<span class="feat-desc">{f.description}</span>
|
||||
<span class="feat-cta">
|
||||
{ctaLabel(f.category)} → <span class="feat-min">{f.minutes} {labels.minutes}</span>
|
||||
{ctaLabel(f.category)} → <span class="feat-min">{`${f.minutes} ${labels.minutes}`}</span>
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
@@ -314,6 +322,12 @@ const ctaLabel = (category: string) =>
|
||||
pointer-events: none;
|
||||
}
|
||||
.archive-featured-inner { overflow: hidden; min-height: 0; }
|
||||
.af-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0.6rem;
|
||||
margin: 0.2rem 0 0.7rem;
|
||||
}
|
||||
.archive-featured-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -321,9 +335,19 @@ const ctaLabel = (category: string) =>
|
||||
font-size: 0.78rem;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
color: var(--faint);
|
||||
margin: 0.2rem 0 0.7rem;
|
||||
/* --faint measured 3.67:1 at this size; AA needs 4.5:1 for small text. */
|
||||
color: var(--muted);
|
||||
margin: 0;
|
||||
}
|
||||
.af-skip {
|
||||
margin-left: auto;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.72rem;
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.af-skip:hover { color: var(--brand); text-decoration: underline; }
|
||||
.af-dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
@@ -393,7 +417,35 @@ const ctaLabel = (category: string) =>
|
||||
gap: 0.35rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.feat-min { color: var(--faint); font-weight: 400; }
|
||||
/* --faint measured 3.04:1 at 12 px; AA needs 4.5:1 for small text. */
|
||||
.feat-min { color: var(--muted); font-weight: 400; }
|
||||
|
||||
/* Phones: three stacked 16:9 cards put the first archive row 2.4 screens down
|
||||
(measured 1235 px of featured + 435 px of controls at 390x844). Lay each card out
|
||||
horizontally instead and drop the excerpt, so the block costs ~1/3 of the height
|
||||
and the year list is reachable in about one screen. */
|
||||
@media (max-width: 700px) {
|
||||
.feat-card { flex-direction: row; align-items: stretch; }
|
||||
.feat-thumb {
|
||||
flex: 0 0 38%;
|
||||
aspect-ratio: auto;
|
||||
align-self: stretch;
|
||||
border-right: 1px solid var(--border);
|
||||
}
|
||||
.feat-thumb img { height: 100%; }
|
||||
.feat-body { flex: 1 1 auto; min-width: 0; padding: 0.55rem 0.65rem 0.6rem; gap: 0.2rem; }
|
||||
.feat-desc { display: none; }
|
||||
.feat-title {
|
||||
font-size: 0.9rem;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
.feat-cta { padding-top: 0.15rem; font-size: 0.72rem; }
|
||||
.feat-top { gap: 0.3rem; }
|
||||
.feat-metric { font-size: 0.64rem; }
|
||||
}
|
||||
|
||||
.archive-status {
|
||||
display: flex;
|
||||
@@ -402,7 +454,8 @@ const ctaLabel = (category: string) =>
|
||||
flex-wrap: wrap;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.74rem;
|
||||
color: var(--faint);
|
||||
/* --faint measured 3.67:1 at 11.8 px; AA needs 4.5:1 for small text. */
|
||||
color: var(--muted);
|
||||
margin: 0 0 0.5rem;
|
||||
min-height: 28px;
|
||||
}
|
||||
@@ -419,7 +472,7 @@ const ctaLabel = (category: string) =>
|
||||
}
|
||||
.archive-clear:hover { border-color: var(--brand); }
|
||||
|
||||
.archive { list-style: none; padding: 0; margin: 0; }
|
||||
.archive { list-style: none; padding: 0; margin: 0; scroll-margin-top: 5.5rem; }
|
||||
.archive-year {
|
||||
font-size: 0.8rem;
|
||||
letter-spacing: 0.08em;
|
||||
|
||||
@@ -141,14 +141,18 @@ const LINE_COLORS: Record<Line['t'], string> = {
|
||||
|
||||
{
|
||||
hasImage ? (
|
||||
// case-studies has its own 21:9 topology banner (the portfolio hero art). At the
|
||||
// 16:9 tile ratio a centre crop would slice the outer host panels in half, so the
|
||||
// card letterboxes it on the same dark ground instead — measured invisible at
|
||||
// #0b1613. One art language for one category, no clipped hardware.
|
||||
<img
|
||||
src={`/categories/${slug}.webp`}
|
||||
src={slug === 'case-studies' ? '/images/categories/case-studies-banner-1200.webp' : `/categories/${slug}.webp`}
|
||||
alt={alt}
|
||||
width="1024"
|
||||
height="576"
|
||||
width={slug === 'case-studies' ? 1200 : 1024}
|
||||
height={slug === 'case-studies' ? 514 : 576}
|
||||
loading={loading}
|
||||
decoding="async"
|
||||
class="category-banner-img"
|
||||
class:list={['category-banner-img', { 'is-wide': slug === 'case-studies' }]}
|
||||
/>
|
||||
) : (
|
||||
<svg
|
||||
|
||||
@@ -26,8 +26,9 @@ const featured = pickFeatured(posts, 'en', 3);
|
||||
>
|
||||
<h1>Posts</h1>
|
||||
<p class="archive-lead">
|
||||
{posts.length} posts, newest first. Filter by title, tag or category below — or read a
|
||||
whole topic through its <a href="/tags/docker/">tag page</a>.
|
||||
{posts.length} posts: three flagship write-ups first, then every post newest-first.
|
||||
Filter by title, tag or category below — or read a whole topic through its
|
||||
<a href="/tags/docker/">tag page</a>.
|
||||
</p>
|
||||
<Archive posts={posts} lang="en" featured={featured} />
|
||||
</BaseLayout>
|
||||
@@ -23,8 +23,8 @@ const featured = pickFeatured(posts, 'zh', 3);
|
||||
>
|
||||
<h1>文章</h1>
|
||||
<p class="archive-lead">
|
||||
共 {posts.length} 篇,按时间倒序。下方可按标题、标签或分类即时筛选,也可以走
|
||||
<a href="/zh/tags/docker/">标签页</a> 把一个主题读完。
|
||||
共 {posts.length} 篇:顶部是 3 篇旗舰复盘,下方全量按时间倒序。可按标题、标签或分类即时筛选,
|
||||
也可以走 <a href="/zh/tags/docker/">标签页</a> 把一个主题读完。
|
||||
</p>
|
||||
<Archive posts={posts} lang="zh" featured={featured} />
|
||||
</BaseLayout>
|
||||
@@ -1461,6 +1461,13 @@ a.category-card:hover { border-color: var(--brand); }
|
||||
display: block;
|
||||
transition: transform 0.25s ease;
|
||||
}
|
||||
/* case-studies ships a 21:9 topology banner. Cropping it to the tile ratio would slice
|
||||
the outer host panels, so it letterboxes on its own dark ground (#0b1613 matches the
|
||||
art's gradient at both edges — verified, no visible seam). */
|
||||
.category-card .art img.is-wide {
|
||||
object-fit: contain;
|
||||
background: #0b1613;
|
||||
}
|
||||
a.category-card:hover .art img {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user