-
Notifications
You must be signed in to change notification settings - Fork 611
Update navbar design and improve search UI #1084
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
Merged
Merged
Changes from 21 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
03491d5
Update navbar design
lhsazevedo 89c598e
Add new search modal dialog
lhsazevedo 8650771
Add search modal e2e tests
lhsazevedo d0da0c8
Remove Hogan.js and typeahead.js
lhsazevedo 831f80c
Update playwright snapshots
lhsazevedo b17b606
Fix e2e and visual tests
lhsazevedo 0048ef1
Avoid page shift when opening the search modal
lhsazevedo b83f783
Match search label and input placeholder text
lhsazevedo 23003ff
Increase contrast for accessibility
lhsazevedo cd0754b
Halve the transition duration of the search modal
lhsazevedo 07da74b
Reduce search scrollbar width
lhsazevedo ec7e9b9
Darken release background to better fit the navbar
lhsazevedo 7146752
Fallback search when Javascript is disabled
lhsazevedo 535b25d
Remove logo alt text
lhsazevedo b8bb98c
Fix modal input type and aria-label
lhsazevedo 75a3e38
Use <kbd> tag
lhsazevedo 9fe9ed1
Use correct CSS methodology
lhsazevedo 4c062ec
Avoid search flash on mobile
lhsazevedo 21b220e
Fix e2e and visual tests
lhsazevedo afaaa2e
Progressively enhance mobile menu and search
lhsazevedo 2f3da84
Add e2e tests for JS disabled search and menu
lhsazevedo ae5a14c
Invalidate old search cache format
lhsazevedo 97a865b
Use a single kbd tag for each arrow key
lhsazevedo 6a4dcd1
Fix leftover vars
lhsazevedo 2d89914
Use current language in legacy global search
lhsazevedo e35fe6e
Add missing docblocks and improve existing ones
lhsazevedo 1fa0853
Use language parameter from outer scope
lhsazevedo d2d68a0
Format search.js
lhsazevedo 39bc218
Tone down result hover background color
lhsazevedo 0d5a896
Update visual tests snapshots
lhsazevedo f97426e
Add search modal visual test
lhsazevedo eb7a39d
Fix visual tests snapshots
lhsazevedo 614a1ad
Close offcanvas menu by outside click
saundefined d54e103
Sync class name with master
lhsazevedo 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 |
|---|---|---|
|
|
@@ -99,7 +99,7 @@ if (!empty($_SERVER['BASE_PAGE']) | |
| <!-- External and third party libraries. --> | ||
| <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> | ||
| <?php | ||
| $jsfiles = ["ext/hogan-3.0.2.min.js", "ext/typeahead.jquery.min.js", "ext/FuzzySearch.min.js", "ext/mousetrap.min.js", "ext/jquery.scrollTo.min.js", "search.js", "common.js"]; | ||
| $jsfiles = ["ext/FuzzySearch.min.js", "ext/mousetrap.min.js", "ext/jquery.scrollTo.min.js", "search.js", "common.js"]; | ||
| foreach ($jsfiles as $filename) { | ||
| $path = dirname(__DIR__) . '/js/' . $filename; | ||
| echo '<script src="/cached.php?t=' . @filemtime($path) . '&f=/js/' . $filename . '"></script>' . "\n"; | ||
|
|
@@ -108,5 +108,71 @@ if (!empty($_SERVER['BASE_PAGE']) | |
|
|
||
| <a id="toTop" href="javascript:;"><span id="toTopHover"></span><img width="40" height="40" alt="To Top" src="/images/[email protected]"></a> | ||
|
|
||
| <div id="search-modal__backdrop" class="search-modal__backdrop"> | ||
| <div | ||
| role="dialog" | ||
| aria-label="Search modal" | ||
| id="search-modal" | ||
| class="search-modal" | ||
| > | ||
| <div class="search-modal__header"> | ||
| <div class="search-modal__form"> | ||
| <div class="search-modal__input-icon"> | ||
| <!-- https://feathericons.com search --> | ||
| <svg xmlns="http://www.w3.org/2000/svg" | ||
| aria-hidden="true" | ||
| width="24" | ||
| viewBox="0 0 24 24" | ||
| fill="none" | ||
| stroke="currentColor" | ||
| stroke-width="2" | ||
| stroke-linecap="round" | ||
| stroke-linejoin="round" | ||
| > | ||
| <circle cx="11" cy="11" r="8"></circle> | ||
| <line x1="21" y1="21" x2="16.65" y2="16.65"></line> | ||
| </svg> | ||
| </div> | ||
| <input | ||
| type="search" | ||
| id="search-modal__input" | ||
| class="search-modal__input" | ||
| placeholder="Search docs" | ||
| aria-label="Search docs" | ||
| /> | ||
| </div> | ||
|
|
||
| <button aria-label="Close" class="search-modal__close"> | ||
| <!-- https://pictogrammers.com/library/mdi/icon/close/ --> | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| aria-hidden="true" | ||
| width="24" | ||
| viewBox="0 0 24 24" | ||
| > | ||
| <path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/> | ||
| </svg> | ||
| </button> | ||
| </div> | ||
| <div | ||
| role="listbox" | ||
| aria-label="Search results" | ||
| id="search-modal__results" | ||
| class="search-modal__results" | ||
| ></div> | ||
| <div class="search-modal__helper-text"> | ||
| <div> | ||
| <kbd>↑ ↓</kbd> to navigate • | ||
| <kbd>Enter</kbd> to select • | ||
| <kbd>Esc</kbd> to close | ||
| </div> | ||
| <div> | ||
| Press <kbd>Enter</kbd> without | ||
| selection to search using Google | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| </body> | ||
| </html> | ||
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
Oops, something went wrong.
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.