@@ -3,6 +3,11 @@ import Headroom from 'react-headroom';
33import NProgress from 'nprogress' ;
44import Router from 'next/router' ;
55import Link from 'next/link' ;
6+ import GoHome from 'react-icons/lib/go/home' ;
7+ import GoBook from 'react-icons/lib/md/school' ;
8+ import GoStar from 'react-icons/lib/md/library-books' ;
9+ import GoCalender from 'react-icons/lib/go/calendar' ;
10+ import GoOrg from 'react-icons/lib/go/organization' ;
611
712import GlobalStyles from './global-styles' ;
813import Head from './head' ;
@@ -29,26 +34,31 @@ export default props => {
2934 title : 'Home' ,
3035 path : '/' ,
3136 external : false ,
37+ icon : GoHome ,
3238 } ,
3339 {
3440 title : 'Learn' ,
3541 path : '/learn' ,
3642 external : false ,
43+ icon : GoBook ,
3744 } ,
3845 {
3946 title : 'Space' ,
4047 path : '/space' ,
4148 external : false ,
49+ icon : GoOrg ,
4250 } ,
4351 {
4452 title : 'Events' ,
4553 path : '/events' ,
4654 external : false ,
55+ icon : GoCalender ,
4756 } ,
4857 {
4958 title : 'Blog' ,
5059 path : 'https://coderplex.org/blog' ,
5160 external : true ,
61+ icon : GoStar ,
5262 } ,
5363 ] ;
5464 return (
@@ -61,6 +71,10 @@ export default props => {
6171 < div className = "nav__logo" >
6272 < img src = "/static/favicons/android-chrome-192x192.png" alt = "" />
6373 </ div >
74+ < input id = "menu" type = "checkbox" />
75+ < label htmlFor = "menu" className = "mobile__menu" >
76+ < span > Menu</ span >
77+ </ label >
6478 < ul className = "nav__links" >
6579 { navItems . map ( item => {
6680 return (
@@ -72,7 +86,8 @@ export default props => {
7286 ? 'nav__link--active'
7387 : '' } `}
7488 >
75- { item . title }
89+ { React . createElement ( item . icon ) }
90+ < span > { item . title } </ span >
7691 </ a >
7792 ) : (
7893 < Link href = { item . path } >
@@ -82,7 +97,8 @@ export default props => {
8297 ? 'nav__link--active'
8398 : '' } `}
8499 >
85- { item . title }
100+ { React . createElement ( item . icon ) }
101+ < span > { item . title } </ span >
86102 </ a >
87103 </ Link >
88104 ) }
@@ -95,9 +111,9 @@ export default props => {
95111 </ header >
96112 < style jsx > { `
97113 header {
98- padding: 5px 20px ;
114+ padding: 5px 10px ;
99115 width: 100%;
100- background: #fff ;
116+ background: #c454df linear-gradient(to top, #ec53ab, #d354cf) ;
101117 z-index: 1000;
102118 }
103119 .header__container {
@@ -106,8 +122,9 @@ export default props => {
106122 }
107123 nav {
108124 display: flex;
109- height: 70px ;
125+ height: 56px ;
110126 align-items: center;
127+ position: relative;
111128 }
112129 .nav__logo {
113130 flex: 1;
@@ -146,27 +163,125 @@ export default props => {
146163 }
147164 .nav__link {
148165 text-decoration: none;
149- color: #666;
150- font-size: 14px;
166+ color: #fff;
167+ font-size: 16px;
168+ font-weight: bold;
151169 padding-bottom: 4px;
170+ display: flex;
171+ align-items: center;
172+ }
173+ .nav__link span {
174+ margin-left: 5px;
152175 }
153176 .nav__link:hover {
154- color: #444 ;
177+ color: #e1e1e1 ;
155178 }
156179 .nav__link--active {
157- color: #444;
158- border-bottom: 2px solid #d900e4;
180+ border-bottom: 2px solid #fff;
159181 pointer-events: none;
160182 }
183+ input[type='checkbox'] {
184+ position: absolute;
185+ opacity: 0;
186+ top: 25px;
187+ left: 25px;
188+ }
189+ .mobile__menu {
190+ width: 30px;
191+ height: 24px;
192+ display: none;
193+ cursor: pointer;
194+ top: 15px;
195+ left: 5px;
196+ position: absolute;
197+ z-index: 1;
198+ }
199+ .mobile__menu:after,
200+ .mobile__menu:before {
201+ content: '';
202+ width: 100%;
203+ height: 2px;
204+ border-radius: 4px;
205+ position: absolute;
206+ background: #fff;
207+ top: 50%;
208+ -webkit-transition: -webkit-transform 0.5s;
209+ transition: -webkit-transform 0.5s;
210+ transition: transform 0.5s;
211+ transition: transform 0.5s, -webkit-transform 0.5s;
212+ -webkit-transform-origin: 50% 50%;
213+ transform-origin: 50% 50%;
214+ }
215+ .mobile__menu:after {
216+ -webkit-transform: translate3d(0, -10px, 0) scale3d(0.8, 1, 1);
217+ transform: translate3d(0, -10px, 0) scale3d(0.8, 1, 1);
218+ }
219+ .mobile__menu:before {
220+ -webkit-transform: translate3d(0, 10px, 0) scale3d(0.8, 1, 1);
221+ transform: translate3d(0, 10px, 0) scale3d(0.8, 1, 1);
222+ }
223+ .mobile__menu span {
224+ position: absolute;
225+ width: 100%;
226+ overflow: hidden;
227+ height: 2px;
228+ border-radius: 4px;
229+ background: #fff;
230+ top: 50%;
231+ -webkit-transition: all 0.5s;
232+ transition: all 0.5s;
233+ }
234+ input[type='checkbox']:checked ~ .mobile__menu span {
235+ -webkit-transform: scale3d(0, 1, 1);
236+ transform: scale3d(0, 1, 1);
237+ }
238+ input[type='checkbox']:checked ~ .mobile__menu:after {
239+ -webkit-transform: rotate3d(0, 0, 1, 45deg);
240+ transform: rotate3d(0, 0, 1, 45deg);
241+ }
242+ input[type='checkbox']:checked ~ .mobile__menu:before {
243+ -webkit-transform: rotate3d(0, 0, 1, -45deg);
244+ transform: rotate3d(0, 0, 1, -45deg);
245+ }
246+ input[type='checkbox']:checked ~ .nav__links {
247+ display: flex;
248+ }
161249 @media (max-width: 700px) {
162250 nav {
163251 justify-content: center;
164252 }
165253 .nav__logo {
166254 flex: initial;
167255 }
256+ .mobile__menu {
257+ display: block;
258+ }
168259 .nav__links {
260+ flex-direction: column;
261+ width: 100%;
262+ position: fixed;
263+ top: 66px;
264+ background: #fafafa;
169265 display: none;
266+ border-bottom: 1px solid #eee;
267+ font-size: 10px;
268+ }
269+ .nav__linkItem {
270+ width: 100%;
271+ border-top: 1px solid #eee;
272+ }
273+ .nav__link {
274+ width: 100%;
275+ font-size: 14px;
276+ font-weight: bold;
277+ padding: 12px 15px;
278+ color: #888;
279+ }
280+ .nav__link:hover {
281+ color: #222;
282+ }
283+ .nav__link--active {
284+ border: none;
170285 }
171286 }
172287 ` } </ style >
0 commit comments