const React = require('react');
-module.exports = ({ links }) => {
+module.exports = ({ links, externalLinks }) => {
const navActions = {
open: () => document.body.classList.add('isNavOpen'),
close: () => document.body.classList.remove('isNavOpen'),
className="Menu-Button"
onMouseOver={navActions.open}
onClick={navActions.toggle}
+ children={'\u2717'}
/>
<div className="Menu-Body">
<h3>Menu</h3>
<ul>
{links.map((link, i) => (
+ <li key={i}>
+ <a
+ href={link.url}
+ onClick={navActions.close}
+ style={{ color: 'inherit' }}
+ >
+ {link.text}
+ </a>
+ </li>
+ ))}
+ </ul>
+ <hr />
+ <ul>
+ {externalLinks.map((link, i) => (
<li key={i}>
<a href={link.url}>{link.text}</a>
</li>
module.exports = (props) => {
return (
- <div className="MusicalInterests">
+ <div className="MusicalInterests" id="music-i-like">
<h2>Music I like</h2>
<HorizontalScroller>
<AlbumCard
.Menu {
color: #333;
- width: 20em;
+ width: 30em;
height: 100vh;
max-width: 100%;
- right: -20em;
+ right: -30em;
position: fixed;
transition: right 0.2s cubic-bezier(0.16, 0.7, 0.53, 1.18);
}
.isNavOpen .Menu {
- right: 0;
+ right: -10em;
}
.Menu-Closer {
.Menu-Button {
z-index: 10;
position: fixed;
+ color: transparent;
+ cursor: pointer;
top: 2em;
right: 2em;
- padding: 0.75em;
+ width: 1.5em;
+ height: 1.5em;
+ line-height: 1.5em;
+ text-align: center;
box-shadow: 0 0 0 0.5em rgba(0, 0, 0, 0.5) inset;
border-radius: 100%;
+ transition: box-shadow 0.2s, color 0.2s;
+}
+
+.isNavOpen .Menu-Button {
+ color: inherit;
+ box-shadow: 0 0 0 0.2em #333 inset;
}
.Menu-Body {
z-index: 9;
position: fixed;
- width: 100%;
+ width: 30em;
height: 100%;
box-sizing: border-box;
border-radius: 1em 0 0 1em;
+ border-right: 10em solid #fff;
padding: 2em;
background-color: #fff;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.2);
<>
<Menu
links={[
+ {
+ url: '#',
+ text: 'Top \u2191',
+ },
+ {
+ url: '#music-i-like',
+ text: 'Music I like',
+ },
+ ]}
+ externalLinks={[
{
url: 'https://github.com/ben-larson/',
text: 'Check out my GitHub \u2197',
color: #46f;
}
+hr {
+ border: 0;
+ border-top: 1px solid #ccc;
+}
+
@media (max-width: 45em) {
body {
font-size: 1em;