-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Implement site header with responsive navigation, mobile menu functionality. #21
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
Jozz77
wants to merge
8
commits into
OWASP-BLT:main
Choose a base branch
from
Jozz77:Fix-Navigation-hamburger-menu-icon-missing-on-mobile-viewports
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 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8beb778
feat: Implement site header with responsive navigation, mobile menu f…
Jozz77 01df9bc
Fixed clearing pending animation timers before scheduling another sta…
Jozz77 5af570b
Use an explicit open/closed state instead of hidden during transitions
Jozz77 35a9def
fixed explicit open/closed state instead of hidden during transitions.
Jozz77 a373f5e
Clear pending close timer in openMenu() to prevent race condition.
Jozz77 f8c4249
Merge branch 'main' of https://github.com/Jozz77/BLT-University into …
Jozz77 144514c
fix: Trim filter text and null-guard data-search before .includes()
Jozz77 40dc3cb
Merge branch 'main' of https://github.com/Jozz77/BLT-University into …
Jozz77 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,57 @@ | ||
| <header class="sticky top-0 w-full z-50 bg-white border-b border-gray-200"> | ||
| <div class="max-w-7xl mx-auto px-6 h-16 flex items-center justify-between"> | ||
| <div class="max-w-7xl mx-auto px-6 h-16 flex items-center justify-between"> | ||
|
|
||
| <!-- Logo --> | ||
| <a href="{{ '/' | relative_url }}" class="flex items-center gap-3 font-semibold text-lg text-gray-900"> | ||
| <div class="w-9 h-9 bg-white rounded-lg shadow-sm flex items-center justify-center overflow-hidden"> | ||
| <img src="{{ site.baseurl }}/assets/images/blt-logo.png" | ||
| alt="BLT Logo" | ||
| class="w-full h-full object-contain p-1"> | ||
| <img src="{{ site.baseurl }}/assets/images/blt-logo.png" alt="BLT Logo" | ||
| class="w-full h-full object-contain p-1"> | ||
| </div> | ||
| <span>{{ site.university.name | default: "BLT University" }}</span> | ||
| </a> | ||
|
|
||
| <!-- Navigation --> | ||
| <!-- Navigation (Desktop) --> | ||
| <nav class="hidden md:flex gap-8 text-sm font-medium text-gray-600"> | ||
| {% for item in site.navigation %} | ||
| <a href="{{ item.url | relative_url }}" | ||
| class="{% if page.url == item.url %} | ||
| <a href="{{ item.url | relative_url }}" class="{% if page.url == item.url %} | ||
| text-bltRed border-b-2 border-bltRed pb-1 | ||
| {% else %} | ||
| hover:text-gray-900 transition-colors | ||
| {% endif %}"> | ||
| {{ item.title }} | ||
| </a> | ||
| {{ item.title }} | ||
| </a> | ||
| {% endfor %} | ||
| </nav> | ||
|
|
||
| <!-- Mobile Menu Button --> | ||
| <button id="mobile-menu-button" type="button" | ||
| class="md:hidden p-2 text-gray-600 hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-bltRed/20 rounded-md transition-all duration-200" | ||
| aria-label="Toggle navigation" | ||
| aria-controls="mobile-menu" | ||
| aria-expanded="false"> | ||
| <svg id="menu-icon" class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | ||
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16m-7 6h7"></path> | ||
| </svg> | ||
| <svg id="close-icon" class="hidden w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"> | ||
| <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path> | ||
| </svg> | ||
| </button> | ||
|
|
||
| </div> | ||
|
|
||
| <!-- Mobile Menu --> | ||
| <div id="mobile-menu" | ||
| class="hidden md:hidden absolute top-16 left-0 w-full bg-white border-b border-gray-100 shadow-xl overflow-hidden transition-all duration-300 ease-in-out opacity-0 max-h-0"> | ||
| <nav class="flex flex-col gap-1 p-4 text-sm font-medium text-gray-600"> | ||
| {% for item in site.navigation %} | ||
| <a href="{{ item.url | relative_url }}" class="px-4 py-3 rounded-lg transition-all duration-200 {% if page.url == item.url %} | ||
| bg-bltRedLight text-bltRed font-semibold | ||
| {% else %} | ||
| hover:bg-gray-50 hover:text-gray-900 | ||
| {% endif %}"> | ||
| {{ item.title }} | ||
| </a> | ||
| {% endfor %} | ||
| </nav> | ||
| </div> | ||
| </header> |
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.
Uh oh!
There was an error while loading. Please reload this page.