-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhero.tsx
More file actions
76 lines (72 loc) · 1.62 KB
/
hero.tsx
File metadata and controls
76 lines (72 loc) · 1.62 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
import { format } from "date-fns";
import { Box, Flex, Heading, HeadingProps } from "theme-ui";
import { Wave } from "~/components/wave";
import { genericInformation } from "~/data/generic";
type HeroHeadingProps = HeadingProps & {
large?: boolean;
};
const HeroHeading: React.FC<HeroHeadingProps> = ({
children,
large,
...props
}) => (
<Heading
{...props}
sx={{
fontSize: large ? "large" : "heading",
textAlign: "center",
color: "white",
}}
>
{children}
</Heading>
);
export const Hero = () => (
<Flex
sx={{
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
background: "url(/background.jpg) center / cover",
minHeight: "100vh",
position: "relative",
pt: ["42rem", "20rem", "14rem"],
"&:before": {
content: '""',
position: "absolute",
top: 0,
left: 0,
width: "100%",
height: "100%",
backgroundColor: "primary",
opacity: 0.6,
"@supports (mix-blend-mode: hard-light)": {
opacity: 1,
mixBlendMode: "hard-light",
},
},
}}
>
<Box
sx={{
zIndex: 1,
m: "auto",
p: "secondary",
}}
>
<HeroHeading as="h1" large>
{genericInformation.siteHeading}
</HeroHeading>
<HeroHeading m={0} as="h2">
{genericInformation.subHeading}
</HeroHeading>
<HeroHeading m={0} as="h2">
{format(
new Date(genericInformation.whenDatetime),
genericInformation.whenFormat
)}
</HeroHeading>
</Box>
<Wave />
</Flex>
);