/>
<div className="Menu-Body">
<h3>Menu</h3>
- <ul>
+ <ul className="Menu-PageLinks">
{sections.map((section, i) => (
<li key={i}>
<a
</li>
))}
</ul>
- <hr />
- <ul>
+ <ul className="Menu-ExternalLinks">
{links.map((link, i) => (
<li key={i}>
- <a href={'https://' + link.url}>{link.text + ' \u2197'} </a>
+ <a href={'https://' + link.url}>
+ <i className={'fa fa-' + link.icon}></i>
+ </a>
</li>
))}
</ul>
.Menu {
+ box-sizing: border-box;
color: #333;
padding: 1em;
- width: 20em;
+ width: 22em;
+ max-width: 100%;
height: 100vh;
right: -22em;
position: fixed;
.Menu-Body {
z-index: 9;
- position: fixed;
- width: 20em;
+ position: relative;
box-sizing: border-box;
border-radius: 1em;
- padding: 2em;
+ padding: 2em 2em 1em 2em;
background-color: #fff;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.2);
transition: box-shadow 0.2s;
list-style-type: none;
}
-.Menu ul li {
+.Menu-PageLinks li {
margin: 1em 0 0 0;
}
-.Menu hr {
- margin-top: 1em;
+.Menu-PageLinks a:hover {
+ box-shadow: 0 3px;
}
-.Menu a:hover {
- box-shadow: 0 3px;
+.Menu-ExternalLinks {
+ display: flex;
+ margin-top: 2em;
+ border-top: 1px solid #ccc;
+}
+
+.Menu-ExternalLinks li {
+ flex: 1;
+ text-align: center;
+}
+
+.Menu-ExternalLinks a {
+ font-size: 1.1em;
+ display: block;
+ padding: 1em 0;
+ transition: color 0.2s;
+}
+
+.Menu-ExternalLinks a:hover {
+ color: inherit;
}
@media (max-width: 25em) {
right: 0;
}
+ .Menu-Button {
+ right: 1.5em;
+ }
+
.Menu-Body {
width: 100%;
height: 100%;
border: 0;
border-radius: 0;
+ padding: 2em 1.5em;
}
}
ReactDom.render(
<>
<Menu
- sections={['Music I like']}
+ sections={['Home', 'Music I like']}
links={[
- { url: 'github.com/ben-larson', text: 'GitHub' },
- { url: 'stackoverflow.com/users/10377586/', text: 'Stack Overflow' },
- { url: 'www.linkedin.com/in/ben-larson-dev', text: 'LinkedIn' },
- { url: 'music.apple.com/profile/benthedev', text: 'Apple Music' },
+ { url: 'github.com/ben-larson', icon: 'github' },
+ { url: 'stackoverflow.com/users/10377586/', icon: 'stack-overflow' },
+ { url: 'linkedin.com/in/ben-larson-dev', icon: 'linkedin' },
+ { url: 'music.apple.com/profile/benthedev', icon: 'apple' },
]}
/>
<Hero
title="Ben Larson"
+ id="home"
lines={[
- '\u2318 Software dev by trade',
- '\u2325 Other things by hobby',
+ '\u2318 Software developer',
+ '\u2325 Serial hobbyist',
'\u2606 Living in Nashville',
]}
/>