-
Notifications
You must be signed in to change notification settings - Fork 2
Made the navbar responsive down to 350px #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JoseBambora
wants to merge
7
commits into
main
Choose a base branch
from
jc/navbar_friendly
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dfc602a
Made the navbar responsive down to 350px
JoseBambora 8d085d5
Updated the header layout.
JoseBambora 95c3114
Improved the look of the 'Go To' menu.
JoseBambora 47fa54e
Final version of the header
JoseBambora 8d967eb
Made the html code more correct.
JoseBambora 0f3b075
Forgot to test code quality
JoseBambora 774596c
Fixed minor things that Nelson sugested.
JoseBambora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,27 +1,100 @@ | ||
<header> | ||
<nav> | ||
<%= live_patch to: Routes.page_path(@conn, :index) do %> | ||
<img | ||
alt="Phoenix Framework Logo" | ||
src={Routes.static_path(@conn, "/karaokium/images/logos/cesium-DARK.svg")} | ||
height="50" | ||
style="margin: 0;" | ||
/> | ||
<%= if @current_user do %> | ||
<div> | ||
<button class="text-center" style="padding: 1px 5px;" onclick="clickedbutton();"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
class="h-6 w-6" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor" | ||
stroke-width="2" | ||
> | ||
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" /> | ||
</svg> | ||
</button> | ||
<script> | ||
var isClicked = false | ||
function pixeis(){ | ||
var result = false | ||
if(window.innerWidth < 700) | ||
result = true | ||
return result | ||
} | ||
function scene1() | ||
{ | ||
document.getElementById("menu2").className = "text-center" | ||
document.getElementById("content").className = "hidden" | ||
document.getElementById("menu").className = "hidden" | ||
} | ||
function scene2() | ||
{ | ||
document.getElementById("menu").className = "text-center" | ||
document.getElementById("menu2").className = "hidden" | ||
document.getElementById("content").className = "container" | ||
} | ||
function clickedbutton() { | ||
isClicked = !isClicked | ||
if(isClicked){ | ||
if(pixeis()) | ||
scene1(); | ||
else | ||
scene2(); | ||
} | ||
else{ | ||
document.getElementById("menu").className = "hidden" | ||
document.getElementById("menu2").className = "hidden" | ||
document.getElementById("content").className = "container" | ||
} | ||
} | ||
function resized() | ||
{ | ||
if(isClicked) | ||
if(pixeis()) | ||
scene1() | ||
else | ||
scene2() | ||
} | ||
window.onresize = resized; | ||
</script> | ||
</div> | ||
<% end %> | ||
<ul> | ||
<%= for entry <- menu(@conn) do %> | ||
<li> | ||
<a href={entry.url}><%= entry.title %></a> | ||
<%= unless Enum.empty?(entry.submenu) do %> | ||
<ul> | ||
<%= for subentry <- entry.submenu do %> | ||
<li><a href={subentry.url}><%= subentry.title %></a></li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
</li> | ||
<div class="text-center"> | ||
<%= live_patch to: Routes.page_path(@conn, :index) do %> | ||
<img | ||
alt="Phoenix Framework Logo" | ||
src={Routes.static_path(@conn, "/karaokium/images/logos/cesium-DARK.svg")} | ||
height="45" | ||
style="margin: 0;" | ||
/> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<%= render("_user_menu.html", assigns) %> | ||
</nav> | ||
</header> | ||
|
||
<div id="menu" class="hidden"> | ||
<%= for entry <- menu(@conn) do %> | ||
<%= unless Enum.empty?(entry.submenu) do %> | ||
| | ||
<%= for subentry <- entry.submenu do %> | ||
<a href={subentry.url}><%= subentry.title %></a> | | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
|
||
<div id="menu2" class="hidden"> | ||
<%= for entry <- menu(@conn) do %> | ||
<%= unless Enum.empty?(entry.submenu) do %> | ||
<ul class="px-0"> | ||
<%= for subentry <- entry.submenu do %> | ||
<li class="list-none"> | ||
<a href={subentry.url}><%= subentry.title %></a> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
<% end %> | ||
</div> |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a fan of this. Maybe we can use Alpine.js and Tailwind's breakpoints to clean this up (@nelsonmestevao)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be really cool to use Alpine and tailwind breakpoints. Should I add alpine to this project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think it would be a good addition