mirror of
https://github.com/thangisme/notes.git
synced 2025-01-22 00:46:27 -05:00
Improved search button and results, added blur to content
(cherry picked from commit 99371e971406090a2dba7b9b69f514a8f87afce3)
This commit is contained in:
parent
7c93bcc48f
commit
887a18daa0
@ -59,7 +59,7 @@ layout: table_wrappers
|
|||||||
</nav>
|
</nav>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="main-content-wrap">
|
<div id="main-content-wrap" class="main-content-wrap">
|
||||||
{% unless page.url == "/" %}
|
{% unless page.url == "/" %}
|
||||||
{% if page.parent %}
|
{% if page.parent %}
|
||||||
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
|
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
|
||||||
|
@ -181,3 +181,12 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-results,
|
||||||
|
.search-button {
|
||||||
|
border: 1px solid rgba($link-color, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.blur {
|
||||||
|
filter: blur(5px);
|
||||||
|
}
|
||||||
|
@ -113,10 +113,12 @@ function initSearch() {
|
|||||||
var docs = data;
|
var docs = data;
|
||||||
var searchInput = document.getElementById('search-input');
|
var searchInput = document.getElementById('search-input');
|
||||||
var searchResults = document.getElementById('search-results');
|
var searchResults = document.getElementById('search-results');
|
||||||
|
var mainContentWrap = document.getElementById('main-content-wrap');
|
||||||
|
|
||||||
function hideResults() {
|
function hideResults() {
|
||||||
searchResults.innerHTML = '';
|
searchResults.innerHTML = '';
|
||||||
searchResults.classList.remove('active');
|
searchResults.classList.remove('active');
|
||||||
|
mainContentWrap.classList.remove('blur');
|
||||||
}
|
}
|
||||||
|
|
||||||
jtd.addEvent(searchInput, 'keydown', function(e){
|
jtd.addEvent(searchInput, 'keydown', function(e){
|
||||||
@ -195,6 +197,7 @@ function initSearch() {
|
|||||||
|
|
||||||
if (results.length > 0) {
|
if (results.length > 0) {
|
||||||
searchResults.classList.add('active');
|
searchResults.classList.add('active');
|
||||||
|
mainContentWrap.classList.add('blur');
|
||||||
var resultsList = document.createElement('ul');
|
var resultsList = document.createElement('ul');
|
||||||
resultsList.classList.add('search-results-list');
|
resultsList.classList.add('search-results-list');
|
||||||
searchResults.appendChild(resultsList);
|
searchResults.appendChild(resultsList);
|
||||||
|
Loading…
Reference in New Issue
Block a user