Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

558 front hamburger menu #799

Merged
merged 23 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/components/main/footer/SocialMediaLinks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TwitterSVG from '@assets/twitter-round.svg';
import FacebookSVG from '@assets/facebook-round.svg';

const SocialMediaLinks = () => (
<div className=" social-media-links navbar-item is-right">
<div className="social-media-links">
<a
className="link"
href="https://twitter.com/data_311"
Expand Down
28 changes: 24 additions & 4 deletions client/components/main/header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import React from 'react';
import React, { useState } from 'react';
import { Link, NavLink } from 'react-router-dom';
import clx from 'classnames';
import COLORS from '../../../styles/COLORS';

const Header = () => {
const [activeBurger, setActiveBurger] = useState(false);

const cta2Style = {
color: COLORS.BRAND.CTA2,
};
Expand All @@ -15,8 +18,12 @@ const Header = () => {
color: COLORS.BRAND.CTA1,
};

const handleClick = () => {
setActiveBurger(!activeBurger);
};

return (
<header
<nav
className="navbar"
role="navigation"
aria-label="main navigation"
Expand All @@ -31,9 +38,22 @@ const Header = () => {
<span className="beta-tag">BETA</span>
</div>
</Link>
<a // eslint-disable-line
role="button"
tabIndex={0}
className={clx('navbar-burger', { 'is-active': activeBurger })}
aria-label="menu"
aria-expanded={activeBurger}
onClick={handleClick}
onKeyDown={handleClick}
>
<span aria-hidden="true" />
<span aria-hidden="true" />
<span aria-hidden="true" />
tan-nate marked this conversation as resolved.
Show resolved Hide resolved
</a>
</div>

<div id="navbar" className="navbar-menu">
<div id="navbar" className={clx('navbar-menu', { 'is-active': activeBurger })}>
<div className="navbar-end">
<div className="navbar-item">
<NavLink exact to="/data" activeClassName="navbar-selected" style={backgroundStyle}>
Expand All @@ -57,7 +77,7 @@ const Header = () => {
</div>
</div>
</div>
</header>
</nav>
);
};

Expand Down
5 changes: 5 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/styles/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
$brand-heading-color: #002449; // dark blue
$brand-text-color: #002449; // dark blue
$brand-main-color: #002449; // dark blue
$brand-main-color-light: #113355; // faded dark blue
$brand-cta1-color: #FFB24A; // orange
$brand-cta2-color: #55D4D2; // light blue
$brand-bg-color: #FFFFFF; // white
Expand Down
15 changes: 14 additions & 1 deletion client/styles/main/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,27 @@ footer.navbar {
color: $brand-bg-color;
text-align: center;
transition: all 0.5s ease 0s;
overflow: scroll;
tan-nate marked this conversation as resolved.
Show resolved Hide resolved

&.menu-is-open {
width: calc(100vw - #{$menu-width});
margin-left: $menu-width;

.last-updated {
@media only screen and (max-width: 1190px) {
display: none;
}
}
}

.last-updated {
display: inline-block;
margin: 0 auto;
line-height: $footer-height;

@media only screen and (max-width: 690px) {
display: none;
}
}

.version {
Expand All @@ -41,7 +52,9 @@ footer.navbar {
}

.social-media-links {
display: table;
margin: 5px 20px 0 0;
position: absolute;
right: 0;

a {
display: table-cell;
Expand Down
51 changes: 48 additions & 3 deletions client/styles/main/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,60 @@
font-size: 20px;
}

.navbar-burger {
color: $brand-bg-color;
height: auto;

span {
width: 30px;
height: 2px;
left: 0;
}

span:nth-child(1) {
top: calc(50% - 8px);
}

span:nth-child(3) {
top: calc(50% + 6px);
}
}

.navbar-burger.is-active {
span:nth-child(1) {
transform: translateY(7px) rotate(45deg);
}

span:nth-child(3) {
transform: translateY(-7px) rotate(-45deg);
}
}

@media only screen and (max-width: 1024px) {
.navbar-menu.is-active {
padding: 0;
background: none;
box-shadow: none;
width: 270px;
position: fixed;
right: 0;

.navbar-item {
margin: 0;
background-color: $brand-main-color-light;
}
}
}

.navbar-menu .navbar-item {
font-size: 16px;
margin-right: 46px;
margin-right: 20px;
}

.navbar-selected {
border-bottom: 5px solid $brand-cta1-color;
border-bottom: 4px solid $brand-cta1-color;
padding-bottom: 2px;
margin-bottom: -7px;
margin-top: 6px;
}

.beta-tag-wrapper {
Expand Down
32 changes: 26 additions & 6 deletions client/styles/main/_staticfooter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,34 @@
font-family: $brand-text-family;
font-size: 14px;
font-weight: normal;
margin-left: 40px;
margin-right: 40px;

margin: 15px 0 0 20px;
position: absolute;

@media only screen and (max-width: 640px) {
margin-top: 0;
}

a {
color: $brand-bg-color;
}
}
.social-media-links {
margin: 5px 20px 0 0;
position: absolute;
right: 0;

&.level-left {
flex: 1;
@media only screen and (max-width: 710px) {
display: none;
}
}

a {
display: table-cell;
vertical-align: middle;
line-height: $footer-height;
height: $footer-height;
}

.icon {
margin: 0 3px;
}
}