Skip to content

Commit 656ffe3

Browse files
committed
feat(home): rewrite home page with featured labs and learn-more row
1 parent dd174f6 commit 656ffe3

2 files changed

Lines changed: 35 additions & 10 deletions

File tree

src/build/entry.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { renderToHtml } from './render'
44
import { createConfig, getBasePath } from './config'
55
import { loadCatalog } from '../catalog/load'
66
import { loadHero } from './hero'
7+
import { loadFeatured } from './featured'
78
import { allRoutes } from './routes'
89
import { Home } from '../pages/home'
910
import { WorkIndex } from '../pages/work/index'
@@ -32,9 +33,10 @@ export async function buildSite(options: BuildOptions): Promise<void> {
3233
buildTime: now.toISOString(),
3334
}
3435

35-
const [catalog, hero] = await Promise.all([
36+
const [catalog, hero, featured] = await Promise.all([
3637
loadCatalog(rootDir),
3738
loadHero(rootDir),
39+
loadFeatured(rootDir),
3840
])
3941
const commitmentBody = await loadContentBody(
4042
join(rootDir, 'content', 'commitment.md'),
@@ -48,6 +50,7 @@ export async function buildSite(options: BuildOptions): Promise<void> {
4850
route,
4951
catalog,
5052
hero,
53+
featured,
5154
commitmentBody,
5255
aboutBody,
5356
config,
@@ -82,14 +85,15 @@ async function render(
8285
route: ReturnType<typeof allRoutes>[number],
8386
catalog: Awaited<ReturnType<typeof loadCatalog>>,
8487
hero: Awaited<ReturnType<typeof loadHero>>,
88+
featured: Awaited<ReturnType<typeof loadFeatured>>,
8589
commitmentBody: string,
8690
aboutBody: string,
8791
config: { basePath: string; buildTime: string },
8892
now: Date,
8993
): Promise<string> {
9094
switch (route.view) {
9195
case 'home':
92-
return renderToHtml(<Home catalog={catalog} hero={hero} config={config} />)
96+
return renderToHtml(<Home hero={hero} featured={featured} config={config} />)
9397
case 'work-index':
9498
return renderToHtml(<WorkIndex catalog={catalog} config={config} />)
9599
case 'health':

src/design/layout.css

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,22 @@
5555
font-size: var(--step-4);
5656
max-inline-size: 22ch;
5757
}
58-
.home-hero__intro {
58+
.home-hero__subtitle {
5959
font-size: var(--step-1);
6060
color: var(--color-ink-subtle);
61+
font-weight: 500;
6162
max-inline-size: var(--measure-prose);
6263
}
63-
.home-stats {
64-
background: var(--color-surface-highlight);
65-
padding: var(--space-6) var(--space-5);
66-
margin-inline: calc(-1 * var(--space-5));
67-
border-radius: var(--radius-md);
64+
.home-intro {
65+
font-size: var(--step-0);
66+
color: var(--color-ink);
67+
max-inline-size: var(--measure-prose);
68+
}
69+
.home-intro p {
70+
margin-block-end: var(--space-3);
71+
}
72+
.home-intro p:last-child {
73+
margin-block-end: 0;
6874
}
6975
.home-featured__header {
7076
display: grid;
@@ -80,15 +86,30 @@
8086
gap: var(--space-5);
8187
margin-block-start: var(--space-4);
8288
}
83-
.home-stats__grid,
89+
.home-learn-more__grid {
90+
display: grid;
91+
gap: var(--space-5);
92+
container-type: inline-size;
93+
margin-block-start: var(--space-4);
94+
}
95+
.home-learn-more__item {
96+
padding: var(--space-5);
97+
background: var(--color-surface);
98+
border-radius: var(--radius-sm);
99+
box-shadow: var(--shadow-card);
100+
}
101+
.home-learn-more__item h3 {
102+
font-size: var(--step-1);
103+
margin-block-end: var(--space-2);
104+
}
84105
.work-index__featured-grid {
85106
display: grid;
86107
gap: var(--space-5);
87108
container-type: inline-size;
88109
}
89110
@container (min-width: 48rem) {
90-
.home-stats__grid { grid-template-columns: repeat(3, 1fr); }
91111
.work-index__featured-grid { grid-template-columns: repeat(2, 1fr); }
112+
.home-learn-more__grid { grid-template-columns: repeat(2, 1fr); }
92113
}
93114
@container (min-width: 72rem) {
94115
.work-index__list { grid-template-columns: repeat(3, 1fr); }

0 commit comments

Comments
 (0)