diff --git a/search.js b/search.js index c5dbdb5..46f02bb 100644 --- a/search.js +++ b/search.js @@ -9,11 +9,12 @@ const fuse = new Fuse(data, { }) const searchBar = document.getElementById('search') +const resultsMax = document.getElementById('resultsMax') const results = document.getElementById('results') function callback() { results.innerHTML = '' - fuse.search(searchBar.value).slice(0,15).forEach(r => { + fuse.search(searchBar.value).slice(0, parseInt(resultsMax.value)).forEach(r => { wrapper = document.createElement('div') wrapper.className = "article" @@ -64,4 +65,5 @@ function callback() { } searchBar.addEventListener('keyup', callback) +resultsMax.addEventListener('keyup', callback) callback() diff --git a/styles.css b/styles.css index 6247f7a..a2156d6 100644 --- a/styles.css +++ b/styles.css @@ -73,13 +73,19 @@ blockquote * { margin: 0; } -#search { +#searchWrapper > input { padding: 1em; - margin: 1em 0 1em 0; + margin: 1em 0.5em 1em 0.5em; font-size: 1em; - width: 100%; + min-width: 0; } +#searchWrapper { + display: flex +} + +#search { flex-grow: 9 } + #results { overflow-x: scroll; } diff --git a/templates/home_index.html b/templates/home_index.html index 1b91114..b9f056f 100644 --- a/templates/home_index.html +++ b/templates/home_index.html @@ -12,11 +12,14 @@ These are my personal notes. Correctness is not guaranteed. Browse here or by tag here.
+page generated by notes2web
+page generated by notes2web