Update content/_index.md

Co-authored-by: Steven Hall <Hallzy.18@gmail.com>
This commit is contained in:
Luke Smith 2022-05-26 23:32:44 +00:00 committed by GitHub
parent 37a50abea3
commit 6fff64138e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,11 @@ document.addEventListener('DOMContentLoaded', () => {
search.addEventListener('input', e => {
// grab search input value
const searchText = e.target.value.toLowerCase()
const hasFilter = searchText.length > 0;
// for each recipe hide all but matched
let matchCount = 0;
rec.forEach(el => {
const recipeName = el.innerText.toLowerCase()
const isMatch = recipeName.includes(searchText)