Problem statement
A recipe index that renders a set of recipe cards from an in-memory dataset and lets the user narrow the list down with a filter form — a title search, a difficulty picker, and a maximum cooking time. A small set of pure filtering helpers and two rendering functions must together read the form, narrow the recipes, and re-render a single results panel that owns the cards, the result count, and the empty state, using Vanilla TypeScript and standard DOM APIs.
Demo
The page, styles, filter form, card template, sample recipe data, and bootstrap wiring are already scaffolded and wired. Only the three modules in src/js/ — filters.ts, renderCard.ts, and renderResults.ts — are missing. Implement them so every test passes. Do not edit any other file.
What to implement
- Show every recipe as a card with the name, cuisine, difficulty, cooking time, and ingredients.
- Let the user narrow the list down using a title search, a difficulty picker, and a maximum cooking time.
- When the user submits the form, only the recipes that match every filter should stay on the page, and the values the user just entered should still be sitting in the form.
- Above the cards, show a small line that says how many recipes are on screen out of the total — for example "Showing 3 of 7".
- When nothing matches, replace the cards with a single message that reads exactly "No recipes match your filters".
- Let the user clear the form with a reset control to bring the full list back.
- Leave the list of recipes you were given unchanged.
- Everything shown must come from the recipes you were given — nothing should be hardcoded.
