-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleaning up Navbar menu to have dropdown options. [WIP - Mobile frien…
…dliness]
- Loading branch information
Showing
5 changed files
with
168 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
.navbar { | ||
margin-bottom: 10px; | ||
background-color: #606c76; | ||
height: 50px; | ||
|
||
> ul { | ||
list-style-type: none; | ||
margin-top: 0; | ||
padding: 0; | ||
display: inline-block; | ||
|
||
> li { | ||
float: left; | ||
margin-bottom: 0; | ||
|
||
a, span { | ||
display: block; | ||
color: white; | ||
text-align: center; | ||
padding: 13px 16px; | ||
text-decoration: none; | ||
} | ||
|
||
&.dropdown { | ||
position: relative; | ||
display: inline-block; | ||
|
||
> .dropdown-content { | ||
display: none; | ||
margin: 0; | ||
list-style-type: none; | ||
position: absolute; | ||
background-color: #f1f1f1; | ||
min-width: 160px; | ||
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); | ||
z-index: 100; | ||
|
||
a, span { | ||
color: #111111; | ||
white-space: nowrap; | ||
} | ||
} | ||
} | ||
|
||
&:hover { | ||
> a, > span { | ||
background-color: #ab5dda; | ||
} | ||
|
||
> .dropdown-content { | ||
display: block; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<nav class="navbar"> | ||
<ul> | ||
<% @main_menu.each do |topic| %> | ||
<% if topic[:submenu] %> | ||
<li class="dropdown"> | ||
<% if topic[:path] %> | ||
<%= link_to topic[:text], topic[:path] %> | ||
<% else %> | ||
<span><%= topic[:text] %></span> | ||
<% end %> | ||
<ul class="dropdown-content"> | ||
<% topic[:submenu].each do |page| %> | ||
<li><%= link_to page[:text], page[:path] %></li> | ||
<% end %> | ||
</ul> | ||
</li> | ||
<% else %> | ||
<li><%= link_to topic[:text], topic[:path] %></li> | ||
<% end %> | ||
<% end %> | ||
</ul> | ||
<ul class="right"> | ||
<% if user_signed_in? %> | ||
<li class="welcome-span"><span>Welcome <%= current_user.email %>!</span></li> | ||
<li><%= link_to "Logout", destroy_user_session_path, method: :delete %></li> | ||
<% else %> | ||
<li class="welcome-span"><span>Welcome guest!</span></li> | ||
<li><%= link_to "Login", new_user_session_path %><li> | ||
<li><%= link_to "Sign up", new_user_registration_path %><li> | ||
<% end %> | ||
</ul> | ||
</nav> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters