Repository navigation
Expand file tree
/
Copy pathFooter.tsx
More file actions
256 lines (246 loc) · 5.99 KB
/
Copy pathFooter.tsx
File metadata and controls
256 lines (246 loc) · 5.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
'use client';
import PanelLink from '@components/panel-link/PanelLink';
import PillButton, { accentFillSx } from '@components/pill-button/PillButton';
import { logAnalyticsEvent } from '@configs/firebase';
import { SECTION_IDS } from '@constants/routes';
import { POLICY_TITLE } from '@data/policy';
import profile from '@data/profile';
import socials from '@data/socials';
import { GitHubIcon } from '@images/icons';
import { Button, Grid, IconButton, Stack, type SxProps, type Theme, Tooltip, Typography } from '@mui/material';
import { colors, focusRing } from '@styles/tokens';
import Link from 'next/link';
/** Small muted text style shared by the footer's policy and cookie-settings links. */
const quietLinkSx: SxProps<Theme> = {
// Positioned so it paints above the fixed starfield, which otherwise intercepts the click, as MUI buttons already do.
position: 'relative',
color: colors.textMuted,
fontSize: '0.875rem',
// Vertical padding gives the small text a taller tap target without moving it.
paddingBlock: 1.5,
textDecoration: 'none',
'&:hover': {
color: colors.text,
textDecoration: 'underline',
},
'&:focus-visible': focusRing,
};
/** Renders the footer. */
export default function Footer() {
return (
<Stack
aria-label='Footer'
direction='column'
id={SECTION_IDS.contact}
spacing={2}
sx={{
alignItems: 'center',
justifyContent: 'center',
margin: '1rem auto',
maxWidth: '90vw',
}}
>
<Typography
aria-label='Interested in working together?'
sx={{
fontSize: 'clamp(1rem, 2rem, 2rem)',
textAlign: 'center',
}}
variant='h2'
>
Interested in working together?
</Typography>
<Stack direction='row' spacing={2}>
<Link
aria-label='Email me mailto'
href={`mailto:${profile.email}`}
prefetch
style={{
textDecoration: 'none',
color: 'inherit',
}}
>
<PillButton
aria-label='Email me'
onClick={() => {
logAnalyticsEvent(`footer-email`, {
name: 'footer-email',
type: 'click',
});
}}
sx={accentFillSx}
>
Email me
</PillButton>
</Link>
<Link
aria-label='Resume download'
href={profile.resumePath}
prefetch
rel='noopener noreferrer'
style={{
textDecoration: 'none',
color: 'inherit',
}}
target='_blank'
>
<PillButton
aria-label='Resume'
color='secondary'
onClick={() => {
logAnalyticsEvent(`footer-resume`, {
name: 'footer-resume',
type: 'click',
});
}}
>
Resume
</PillButton>
</Link>
</Stack>
<Grid
className='socials'
container
direction='row'
id='socials'
spacing={1}
sx={{
alignItems: 'center',
justifyContent: 'center',
margin: 'auto',
maxWidth: 'min(480px, 90vw)',
}}
>
{socials.map((social) => (
<Grid
key={`${social.name}-grid-item`}
sx={{
alignItems: 'center',
display: 'flex',
justifyContent: 'center',
}}
size={{
lg: 2,
md: 3,
xs: 4,
}}
>
<Link
key={`${social.name}-link`}
aria-label={`${social.name} link`}
href={social.url}
prefetch
rel='noopener noreferrer'
style={{
color: 'inherit',
textDecoration: 'none',
}}
target='_blank'
>
<Tooltip arrow describeChild title={social.name}>
<IconButton
aria-label={social.name}
color='inherit'
onClick={() => {
logAnalyticsEvent(`footer-${social.name.toLowerCase()}`, {
name: `footer-${social.name.toLowerCase()}`,
type: 'click',
});
}}
size='large'
sx={{
color: social.color ?? 'primary.main',
filter: `drop-shadow(0px 2px 3px color-mix(in srgb, ${social.color ?? 'primary.main'} 45%, transparent))`,
transition:
'color .2s ease-in-out, background-color .2s ease-in-out, transform .2s ease-in-out',
'&:hover': {
backgroundColor: '#2c3443',
color: social.color ?? 'primary.main',
filter: `drop-shadow(0px 4px 4px ${social.color ?? 'primary.main'})`,
transform: 'scale(1.1)',
},
}}
>
{social.icon({})}
</IconButton>
</Tooltip>
</Link>
</Grid>
))}
</Grid>
<Typography
sx={{
textAlign: 'center',
}}
>
Handcrafted by <br /> Alexander Joo-Hyun Sullivan
</Typography>
<Typography
sx={{
alignItems: 'center',
display: 'flex',
justifyContent: 'center',
textAlign: 'center',
}}
>
Open-source on{' '}
<Link
aria-label='GitHub repository'
href={profile.sourceRepository}
onClick={() => {
logAnalyticsEvent(`footer-open-source`, {
name: 'footer-open-source',
type: 'click',
});
}}
prefetch
rel='noopener noreferrer'
style={{
color: 'inherit',
marginLeft: '0.25rem',
textDecoration: 'none',
}}
target='_blank'
>
<Button
aria-label='GitHub repository button'
sx={{
alignItems: 'center',
color: '#fff',
display: 'inline-flex',
fontWeight: 600,
transition: 'all .2s ease-in-out',
svg: {
transition: 'all .2s ease-in-out',
},
'&:hover': {
backgroundColor: '#2c3443',
svg: {
transform: 'scale(1.1)',
},
},
}}
>
<GitHubIcon
sx={{
marginRight: '0.25rem',
}}
/>
GitHub
</Button>
</Link>
</Typography>
<Stack
direction='row'
sx={{ alignItems: 'center', columnGap: 3, flexWrap: 'wrap', justifyContent: 'center', rowGap: 1 }}
>
<PanelLink aria-haspopup='dialog' panel={SECTION_IDS.policy} sx={quietLinkSx}>
{POLICY_TITLE}
</PanelLink>
<PanelLink panel={SECTION_IDS.cookieSettings} sx={quietLinkSx}>
Cookie settings
</PanelLink>
</Stack>
</Stack>
);
}