-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.js
97 lines (84 loc) · 1.82 KB
/
header.js
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
import { Link } from "gatsby"
import styled from "@emotion/styled"
import PropTypes from "prop-types"
import React from "react"
const Content = styled.div`
max-width: 860px;
padding: 1rem 1.0875rem;
font-size: 1.2rem;
`
const NavLink = styled(Link)`
color: black;
margin-left: 15px;
text-decoration: none;
display: inline-block;
position: relative;
::after {
content: "";
position: absolute;
width: 100%;
transform: scaleX(0);
height: 2px;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
transform-origin: bottom right;
transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
}
:hover::after {
transform: scaleX(1);
transform-origin: bottom left;
}
`
const GitHubLink = styled.a`
color: black;
margin-left: 15px;
text-decoration: none;
display: inline-block;
position: relative;
::after {
content: "";
position: absolute;
width: 100%;
transform: scaleX(0);
height: 2px;
bottom: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
transform-origin: bottom right;
transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
}
:hover::after {
transform: scaleX(1);
transform-origin: bottom left;
}
`
const HomeLink = styled(NavLink)`
margin-left: 0;
`
const SiteHeader = styled.header`
background: transparent;
display: flex;
align-content: center;
justify-content: center;
`
const Header = ({ siteTitle }) => (
<SiteHeader>
<Content>
<p>
<HomeLink to="/">{siteTitle}</HomeLink>
<NavLink to="/blog">Blog</NavLink>
<GitHubLink href="https://github.com/kytol">
GitHub
</GitHubLink>
</p>
</Content>
</SiteHeader>
)
Header.propTypes = {
siteTitle: PropTypes.string,
}
Header.defaultProps = {
siteTitle: ``,
}
export default Header