Movie Catalog
A small app about rendering lists properly: filter while you type, sort by title or release date, and open a details page for any film.
Technologies
- HTML
- CSS
- JavaScript
- DOM rendering
Search filters the list, the sort control reorders it, one render function draws it
Problem
Showing a list is easy. Keeping it correct while the user searches and re-sorts it, without duplicating render code, is the actual exercise.
Solution
One render function drives the interface. Search filters the data, the sort control reorders it A–Z, Z–A or newest first, and selecting a film opens its details page.
One list, three controls
Search, sort and navigation all change the same list — so they all go through the same render.
Film data
Title, poster and release date
Search
filter() on the title as you type
Sort
A–Z, Z–A or newest first
render()
One function draws the whole list
Details page
Opens the selected film
Key features
- Search
- Sorting by title and release date
- Film details page
- A single render function for the list
What I learned
- Keeping the data and the rendered DOM in sync
- filter, sort and map where they actually belong
- Writing one render function instead of repeating markup