feat: port cms home layout into trade-pro (hero/features/cards/cta + reveal JS)
Task 10a (Phase 3 first layout task). home.html now mirrors the cms astro-site-runtime homepage section sequence: full-bleed hero (single active slide; the platform has no multi-slide config, so the carousel dots/JS are not ported), trustbar, two-col about with floating stats, soft products band (4-card grid), dark applications band (2x2 case tiles), advantages feature grid, soft news band (3-card grid), and the closing cta band. Data maps to SiteForge context (page.cover/summary, showcase, cases, stories, category/brand counts); empty sections hide instead of rendering shells. All new component classes are sf-tp-* prefixed and compose on the Task 8 base utilities in theme.css (.wrap/.section/.eyebrow/.icon-circle/.sf-tp-btn). CSS: the five cms components' scoped styles (PageHero, FeatureGrid, CardGrid, Cta, SectionHead + the inline homepage bands) are extracted into pro.css as the sf-tp-* component layer, tokens rewritten to --sf-tp-*, breakpoints 900/767/620 preserved. theme.css accordingly drops the superseded generic .cards/.card/.feature mobile baselines and the .pro-home-hero em bridge, and retargets the dark-surface ghost button hook from .cta-band to .sf-tp-cta. Reveal: cms uses data-reveal everywhere; a ~15-line inline script at the pro.html tail adds html.js + an IntersectionObserver that toggles is-visible (the reduced-motion/no-JS exemptions already live in theme.css from Task 8). Tests: test_theme_registry gains test_trade_pro_home_layout_structure (preview-render contract: sf-tp-hero, card grid, feature grid, cta, no pro-industrial-hero residue, reveal script). The distinct-markup tripwire in test_theme_pro_v3 is legitimately updated 4 -> 5 (renamed to drop the stale "four"): with trade-pro now carrying its own sf-tp-hero class, five themes yield five distinct hero signatures, which is what the test always meant to enforce. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -464,7 +464,7 @@ body.sf-theme-trade-pro {
|
||||
|
||||
/* 深色表面上的描边按钮 */
|
||||
.section--dark .sf-tp-btn--ghost,
|
||||
.cta-band .sf-tp-btn--ghost {
|
||||
.sf-tp-cta .sf-tp-btn--ghost {
|
||||
background: var(--sf-tp-color-surface-default);
|
||||
color: var(--sf-tp-color-text-brand);
|
||||
}
|
||||
@@ -636,17 +636,14 @@ body.sf-theme-trade-pro {
|
||||
padding-inline-start: calc(var(--sf-tp-icon-size-md, 20px) + var(--sf-tp-space-6));
|
||||
}
|
||||
|
||||
/* ── Phase 2 桥接:骨架期 .pro-* 强调样式改由 cms 令牌驱动(Task 10 布局移植后由组件样式接管)── */
|
||||
/* ── Phase 2 桥接:骨架期 .pro-* 强调样式改由 cms 令牌驱动(home 布局已由
|
||||
pro.css 的 sf-tp-* 组件层接管,Task 10a 起仅保留 utility 条)── */
|
||||
|
||||
.pro-utility {
|
||||
background: var(--sf-tp-color-surface-inverse);
|
||||
color: var(--sf-tp-color-text-inverse-muted);
|
||||
}
|
||||
|
||||
.pro-home-hero em {
|
||||
color: var(--sf-tp-color-text-brand);
|
||||
}
|
||||
|
||||
/* ── 滚动浮现动效(渐进增强:仅在 JS 打开 html.js 且注册 IntersectionObserver
|
||||
后生效——Task 10 随布局引入配套 JS;无 JS/reduced-motion 时默认可见)── */
|
||||
|
||||
@@ -732,66 +729,9 @@ body.sf-theme-trade-pro {
|
||||
|
||||
.section { padding-block: 30px; }
|
||||
|
||||
/* 卡片:2 列紧凑(组件类,桌面形态随 Task 10 移植) */
|
||||
.cards {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.card { border-radius: 7px; }
|
||||
|
||||
.card-media {
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
padding: 9px 10px 11px;
|
||||
}
|
||||
|
||||
.card h3 {
|
||||
font-size: 13px;
|
||||
margin-block-end: 2px;
|
||||
}
|
||||
|
||||
.card p {
|
||||
font-size: 11px;
|
||||
line-height: 1.25;
|
||||
margin-block-end: 5px;
|
||||
}
|
||||
|
||||
.more { font-size: 10px; }
|
||||
|
||||
/* 特性:2 列横排(图标左、文字右) */
|
||||
.feature-grid {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.feature {
|
||||
min-height: 92px;
|
||||
text-align: left;
|
||||
padding: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: 44px 1fr;
|
||||
align-content: center;
|
||||
column-gap: 7px;
|
||||
}
|
||||
|
||||
.feature .icon-circle {
|
||||
grid-row: 1 / 3;
|
||||
align-self: center;
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.feature h3 {
|
||||
font-size: 12px;
|
||||
margin: 0 0 3px;
|
||||
}
|
||||
|
||||
.feature p {
|
||||
font-size: 10px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
/* 卡片/特性等组件的移动端形态已随 Task 10a 移入 pro.css 的
|
||||
sf-tp-* 组件层(.sf-tp-card-grid / .sf-tp-feature-grid 等),
|
||||
本文件只保留元素基线与共享工具类。 */
|
||||
|
||||
/* 选项卡 */
|
||||
.tabs { gap: 8px; margin-block-end: 16px; }
|
||||
|
||||
Reference in New Issue
Block a user