Skip to content

Commit 55f8809

Browse files
committed
better nav experience on small screens
1 parent 5cd34b8 commit 55f8809

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

source/javascripts/menu.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ $(function() {
4444
dataType: "jsonp"
4545
});
4646

47+
$(".sidebar-nav").click(function (e) {
48+
if(e.target == this){
49+
$(this).toggleClass("shown");
50+
}
51+
});
52+
4753
});

source/stylesheets/style.css

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,39 @@ body:before {
180180
margin-top:-32767px;/
181181
}
182182

183+
.sidebar-nav {
184+
height: 45px;
185+
margin-bottom: 10px;
186+
background-color: #f5f5f5;
187+
border: 1px solid #eee;
188+
border: 1px solid rgba(0,0,0,0.05);
189+
-webkit-border-radius: 4px;
190+
-moz-border-radius: 4px;
191+
border-radius: 4px;
192+
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
193+
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
194+
box-shadow: inset 0 1px 1px rgba(0,0,0,0.05);
195+
}
196+
.sidebar-nav:before {
197+
display: block;
198+
padding: 10px;
199+
cursor: pointer;
200+
content: "Menu";
201+
font-size: 15px;
202+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
203+
font-weight: bold;
204+
color: #08c;
205+
}
206+
.sidebar-nav:hover, .sidebar-nav.shown {
207+
height: auto;
208+
}
209+
.sidebar-nav #nav-menu {
210+
display: none;
211+
}
212+
.sidebar-nav:hover #nav-menu, .sidebar-nav.shown #nav-menu {
213+
display: block;
214+
}
215+
183216
.sidebar-nav > #nav-menu { border-right: 1px solid #ddd; font-size: 18px; line-height:21px; }
184217

185218
.callout > a { color: rgb(240, 132, 2); }
@@ -251,3 +284,24 @@ li.official {
251284
width: 100%;
252285
height: 100%;
253286
}
287+
288+
@media (min-width: 767px) {
289+
.sidebar-nav {
290+
height: auto;
291+
background: transparent;
292+
margin: 0;
293+
border: none;
294+
-webkit-border-radius: 0;
295+
-moz-border-radius: 0;
296+
border-radius: 0;
297+
-webkit-box-shadow: none;
298+
-moz-box-shadow: none;
299+
box-shadow: none;
300+
}
301+
.sidebar-nav:before {
302+
content: "";
303+
}
304+
.sidebar-nav #nav-menu {
305+
display: block;
306+
}
307+
}

0 commit comments

Comments
 (0)