Skip to content

Commit 4108dc6

Browse files
committed
feat: add styled components for homepage layout and structure
1 parent 7bfc74d commit 4108dc6

2 files changed

Lines changed: 97 additions & 15 deletions

File tree

‎src/pages/index.styles.ts‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import styled from 'styled-components'
2+
3+
import { Link } from '../components/Link'
4+
import { $theme } from '../styles/theme'
5+
import { theme } from '../theme'
6+
7+
export const Hero = styled.div`
8+
text-align: center;
9+
padding: 3rem 0 4rem;
10+
`
11+
12+
export const Greeting = styled.h1`
13+
font-size: ${$theme.fontSize.l2}rem;
14+
font-weight: ${$theme.fontWeight.black};
15+
color: ${$theme.color.copy};
16+
line-height: 1;
17+
margin: 0 0 0.75rem;
18+
19+
${theme.breakpoints.up('lg')} {
20+
font-size: ${$theme.fontSize.l1}rem;
21+
}
22+
`
23+
24+
export const CardGrid = styled.div`
25+
display: grid;
26+
grid-template-columns: 1fr;
27+
gap: 1.5rem;
28+
padding-bottom: 4rem;
29+
30+
${theme.breakpoints.up('md')} {
31+
grid-template-columns: 1fr 1fr;
32+
}
33+
`
34+
35+
export const Card = styled(Link)`
36+
display: flex;
37+
flex-direction: column;
38+
border: ${$theme.color.secondary} solid 2px;
39+
border-radius: 4px;
40+
padding: 2rem;
41+
text-decoration: none;
42+
color: ${$theme.color.copy};
43+
transition: ${$theme.transition.default};
44+
45+
&:hover {
46+
border-color: ${$theme.color.primary};
47+
background-color: ${$theme.color.primary}0a;
48+
}
49+
`
50+
51+
export const CardIcon = styled.div`
52+
font-family: 'Source Code Pro', Consolas, Monaco, monospace;
53+
font-size: 1.75rem;
54+
color: ${$theme.color.primary};
55+
margin-bottom: 1.25rem;
56+
line-height: 1;
57+
`
58+
59+
export const CardTitle = styled.h2`
60+
font-size: ${$theme.fontSize.l2}rem;
61+
font-weight: ${$theme.fontWeight.black};
62+
line-height: 1;
63+
margin: 0 0 0.75rem;
64+
`
65+
66+
export const CardDescription = styled.p`
67+
font-size: ${$theme.fontSize.copy1}rem;
68+
color: ${$theme.color.copyLight};
69+
margin: 0;
70+
flex-grow: 1;
71+
`
72+
73+
export const CardCTA = styled.span`
74+
display: inline-block;
75+
margin-top: 1.5rem;
76+
font-size: ${$theme.fontSize.copy2}rem;
77+
color: ${$theme.color.primary};
78+
font-weight: ${$theme.fontWeight.semiBold};
79+
`

‎src/pages/index.tsx‎

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
import * as React from 'react'
22

3-
import { Link } from '../components/Link'
43
import { SEO } from '../components/SEO'
5-
import { TextBlock } from '../components/Typography'
64
import { MainLayout } from '../layouts/MainLayout'
5+
import * as S from './index.styles'
76

87
export const Head = () => <SEO title="Home" />
98

109
const IndexPage: React.FC = () => {
1110
return (
1211
<MainLayout>
13-
<TextBlock>
14-
<pre className="language-javascript">
15-
<code className="language-javascript">
16-
// TODO: Complete website...
17-
<br />
18-
// I'm currently fighting a cancer again. This is{' '}
19-
<Link to="/lymphoma/2025-09-18/">the third time</Link>.
20-
<br />
21-
// I created a blog about it, take a look at it{' '}
22-
<Link to="/lymphoma">here</Link>.
23-
</code>
24-
</pre>
25-
</TextBlock>
12+
<S.Hero>
13+
<S.Greeting>Hi, I'm Rubens</S.Greeting>
14+
</S.Hero>
15+
<S.CardGrid>
16+
<S.Card to="/code">
17+
<S.CardIcon>{'{ }'}</S.CardIcon>
18+
<S.CardTitle>Code</S.CardTitle>
19+
<S.CardDescription>I build things.</S.CardDescription>
20+
<S.CardCTA>See my work →</S.CardCTA>
21+
</S.Card>
22+
<S.Card to="/lymphoma">
23+
<S.CardIcon>♥</S.CardIcon>
24+
<S.CardTitle>Lymphoma</S.CardTitle>
25+
<S.CardDescription>I fight things.</S.CardDescription>
26+
<S.CardCTA>Read my journey →</S.CardCTA>
27+
</S.Card>
28+
</S.CardGrid>
2629
</MainLayout>
2730
)
2831
}

0 commit comments

Comments
 (0)