Skip to content

Commit 986cf3b

Browse files
committed
responsive nav bar, allproducts.json update
1 parent 815f0e1 commit 986cf3b

File tree

4 files changed

+55
-14
lines changed

4 files changed

+55
-14
lines changed

assets/css/main.css

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,23 +2183,30 @@ input, select, textarea {
21832183
}
21842184

21852185
/* Nav */
2186-
#nav ul.links {
2186+
#nav ul {
21872187
display: flex;
21882188
flex: 1;
21892189
list-style: none;
21902190
justify-content: center;
21912191
margin: 0;
2192+
padding: 0;
21922193
}
2193-
#nav li {
2194+
2195+
#nav li.links {
21942196
display: inline-flex;
21952197
margin: 0;
21962198
background-color: inherit;
21972199
line-height: 1em;
21982200
cursor: pointer;
2199-
font-weight:400;
2200-
font-size:1rem;
2201+
/* font-weight:400; */
2202+
/* font-size:1rem; */
22012203
text-transform: uppercase;
22022204
font-family: "Source Sans Pro", Helvetica, sans-serif;
2205+
padding: 0;
2206+
}
2207+
2208+
#nav .menu{
2209+
display: none;
22032210
}
22042211

22052212
#nav a {
@@ -2220,11 +2227,29 @@ input, select, textarea {
22202227

22212228
#nav li.active {
22222229
background-color: white;
2230+
border-bottom: transparent;
22232231
}
22242232
#nav li.active > a {
22252233
color: var(--primary);
22262234
}
22272235

2236+
@media screen and (max-width: 768px) {
2237+
#nav ul {
2238+
flex-direction: column-reverse;
2239+
padding: 0;
2240+
}
2241+
2242+
#nav li.links {
2243+
display: none;
2244+
}
2245+
2246+
#nav .menu {
2247+
display: flex;
2248+
flex-grow: 1;
2249+
justify-content: flex-end;
2250+
}
2251+
}
2252+
22282253
/* Button */
22292254

22302255
input[type="submit"],
@@ -8999,7 +9024,7 @@ input, select, textarea {
89999024
box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.075);
90009025
}
90019026

9002-
#wrapper.divided > *:first-child {
9027+
#wrapper.divided > *:first-child, #main {
90039028
box-shadow: none !important;
90049029
}
90059030

assets/db/allproducts.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

assets/js/util.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,4 +641,17 @@ function calculatorSetup (fn, version) {
641641

642642
function getIsMetric (name = 'units') {
643643
return $('input[type=radio][name=' + name + ']:checked').val() === '1'; // inches (val=0) or cm (val=1)
644+
}
645+
646+
/* Toggle between showing and hiding the navigation menu links when the user clicks on the hamburger menu / bar icon */
647+
function navCollapse() {
648+
var elms = document.querySelectorAll("li.links");
649+
650+
Array.from(elms).forEach((x) => {
651+
if (x.style.display === "inline-flex") {
652+
x.style.display = "none";
653+
} else {
654+
x.style.display = "inline-flex";
655+
}
656+
})
644657
}

map.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,24 @@
4444
</script>
4545
<!-- Global site tag (gtag.js) - Google Analytics GA4 -->
4646
</head>
47-
<body class="is-preload">
47+
<body>
4848
<!-- Wrapper -->
49-
<div id="wrapper" >
49+
<div id="wrapper" class="divided">
5050

5151
<!-- Banner -->
5252
<header-template></header-template>
5353

5454
<section class="color8 invert align-center">
5555
<nav id="nav">
56-
<ul class="links">
57-
<li><a href="zerotohero.html">Getting Started</a></li>
58-
<li><a href="index.html">Patterns</a></li>
59-
<li><a href="fabrics.html">Pack Fabrics</a></li>
60-
<li><a href="hardware.html">Parts Picker</a></li>
61-
<li class="active"><a href="#">Supplier Map</a></li>
56+
<ul >
57+
<li class="links"><a href="zerotohero.html">Getting Started</a></li>
58+
<li class="links"><a href="index.html">Patterns</a></li>
59+
<li class="links"><a href="fabrics.html">Fabrics</a></li>
60+
<li class="links"><a href="hardware.html">Hardware</a></li>
61+
<li class="links active"><a href="#">MYOG Suppliers</a></li>
62+
<li class="menu"><a href="javascript:void(0);" class="icon" onclick="navCollapse()">
63+
<i class="fa fa-bars"></i>
64+
</a></li>
6265
</ul>
6366
</nav>
6467
</section>

0 commit comments

Comments
 (0)