Skip to content

Commit b04266f

Browse files
committed
Add responsive menu
1 parent bb41ec9 commit b04266f

4 files changed

Lines changed: 87 additions & 7 deletions

File tree

public/css/custom.css

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,15 @@ input:read-only {
406406
}
407407

408408
@media screen and (max-width: 900px) {
409-
#navbar {
410-
display: none;
409+
.mobileNav {
410+
display: block !important;
411+
}
412+
.nav {
413+
display: none !important;
414+
}
415+
416+
.navLogo {
417+
display: none !important;
411418
}
412419

413420
section.triplesec {
@@ -470,10 +477,6 @@ input:read-only {
470477
display: none;
471478
}
472479

473-
#subnav {
474-
display: none;
475-
}
476-
477480
section.tryitout {
478481
width: 90% !important;
479482
}
@@ -506,3 +509,56 @@ input:read-only {
506509
}
507510

508511
.invisible { display: none; }
512+
513+
514+
.mobileNav {
515+
display: none;
516+
position: fixed;
517+
width: 100%;
518+
top: 0;
519+
z-index: 10;
520+
}
521+
.mobileNav div {
522+
display: none;
523+
}
524+
.mobileNav button {
525+
position: absolute;
526+
top: 15px;
527+
right: 15px;
528+
border: 0;
529+
text-indent: 200%;
530+
overflow: hidden;
531+
background: rgba(255,255,255,0.8) url("http://i.imgur.com/vKRaKDX.png") center no-repeat;
532+
border: 1px solid #ddd;
533+
border-radius: 3px;
534+
background-size: 80%;
535+
width: 40px;
536+
height: 40px;
537+
outline: none;
538+
-webkit-transition: all 400ms ease;
539+
transition: all 400ms ease;
540+
}
541+
.mobileNav button.expanded {
542+
-webkit-transform: rotate(90deg);
543+
transform: rotate(90deg);
544+
background-color: transparent;
545+
border: 0;
546+
}
547+
.mobileNav a {
548+
display: block;
549+
}
550+
551+
.mobileNav a {
552+
background: #eee;
553+
text-align: center;
554+
padding: 20px 0;
555+
border-bottom: 1px solid #ddd;
556+
text-decoration: none;
557+
color: #222;
558+
font-weight: bold;
559+
}
560+
.mobileNav a:hover,
561+
a:active,
562+
a:focus {
563+
background: #e7e7e7;
564+
}

public/css/demoEditor.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
white-space: -pre-wrap; /* Opera 4-6 */
1414
white-space: -o-pre-wrap; /* Opera 7 */
1515
word-wrap: break-word; /* Internet Explorer 5.5+ */
16-
height: 250px;
16+
height: 240px;
1717
border: solid #CECECE 1px !important;
1818
margin-top: 0px;
1919
width: 100%;
@@ -25,6 +25,7 @@
2525
width: 50%;
2626
margin-top: 5px;
2727
height: 250px;
28+
border: solid #CECECE 1px !important;
2829
}
2930

3031
#submit {

src/js/general.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ $(() => {
3232
setInterval(() => {
3333
updateDates();
3434
}, 60000);
35+
36+
$('.toggleButton').click(function() {
37+
$(this).toggleClass('expanded').siblings('div').slideToggle();
38+
});
3539
});
3640

3741
function notyPrompt(text, yes, no) {

views/snippets/navbar.ejs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,22 @@ if (session.user !== undefined && session.user.tierName === 'Free') {
6666
</ul>
6767
</div>
6868
</div>
69+
<div class="mobileNav">
70+
<button class="toggleButton">Toggle</button>
71+
<div class="mobileMenu">
72+
<% if (session.loggedin === true) { %>
73+
<a href="">Home</a>
74+
<a href="<%= upgrade %>">Upgrade</a>
75+
<a href="documentation">Documentation</a>
76+
<a href="settings">Settings</a>
77+
<a href="logout">Logout</a>
78+
<% } else { %>
79+
<a href="">Home</a>
80+
<a href="search">Search</a>
81+
<a href="pricing">Pricing</a>
82+
<a href="documentation">Documentation</a>
83+
<a href="login">Login</a>
84+
<a href="register">Sign Up</a>
85+
<% } %>
86+
</div>
87+
</div>

0 commit comments

Comments
 (0)