Skip to content

Commit be40056

Browse files
committed
added mobile stuff
1 parent 93c8ba9 commit be40056

21 files changed

+1766
-579
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ node_modules/
2525
# Brunch output folder.
2626
public/
2727
_assets/
28+
_design/

app/assets/index.html

Lines changed: 281 additions & 212 deletions
Large diffs are not rendered by default.

app/scripts/main.js

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,60 @@
1-
$(document).ready(()=>{
2-
// lets write some search box code
3-
})
1+
var $ = require('jquery');
2+
var _ = require('lodash/function');
3+
4+
$(document).ready(function(){
5+
6+
7+
// SIDE NAV WIDGET
8+
var sideNavOpen = false;
9+
10+
var $sideNav = $('#side-nav');
11+
var $wrapper = $('#wrapper');
12+
13+
function listenForSideNav($hamburger){
14+
$hamburger.on('click', ()=>{
15+
$hamburger.toggleClass('is-active');
16+
var sideNavWidth = $sideNav.outerWidth();
17+
18+
$wrapper.toggleClass('side-nav-active');
19+
$sideNav.toggleClass('side-nav-active');
20+
21+
if(sideNavOpen){
22+
$wrapper.css('left', '0');
23+
sideNavOpen = false;
24+
} else {
25+
$wrapper.css('left', `${sideNavWidth}px`);
26+
sideNavOpen = true;
27+
}
28+
});
29+
}
30+
31+
listenForSideNav($('#main-header .hamburger'));
32+
listenForSideNav($('#scroll-nav .hamburger'));
33+
34+
35+
36+
// TEXT SIZE WIDGET
37+
var $textSizeOptions = $('#side-nav .change-text-size .option');
38+
$textSizeOptions.click(function(){
39+
$textSizeOptions.removeClass('active');
40+
$(this).addClass('active')
41+
});
42+
43+
44+
45+
// SCROLL NAV
46+
var headerHeight = $('#main-header .nav-row-one').innerHeight();
47+
console.log(headerHeight);
48+
var $scrollNav = $('#scroll-nav');
49+
50+
function checkForScrollNav(){
51+
if(window.scrollY > headerHeight){
52+
$scrollNav.addClass('active');
53+
} else {
54+
$scrollNav.removeClass('active');
55+
}
56+
}
57+
checkForScrollNav();
58+
$(window).scroll(_.throttle(checkForScrollNav, 50));
59+
60+
});
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
*{
22
box-sizing: border-box;
33
}
4-
h1,h2,h3,h4,h5,h6{
5-
margin: 0;
4+
body{
5+
overflow-x: hidden;
66
}
7+
h1,h2,h3,h4,h5,h6,
78
.h1,.h2,.h3,.h4,.h5,.h6{
89
margin: 0;
910
}

0 commit comments

Comments
 (0)