For this project, I built a user interface, using HTML, and populated it with data from a JavaScript object movieData. This object contains four films, which are keys in the movieData object (e.g. “The Darjeeling Limited”). Each of these keys relates to a value with more detail about that particular movie.
This project's requirements were to:
- Store the object below in a JavaScript file in your codebase
- Render the data onto the webpage with DOM Manipulation
- Allow the user to affect the display of the data by interacting with the webpage
- Allow the user to update the data stored in the object by interacting with the webpage
I broke down this project into steps. First, I extracted the data from the JavaScript object and rendered it into a table using DOM manipulation. I chose to display the data in a table as this would allow the user to easily manipulate the data. Next, I added a form for the user to add additional films to the database, including checks to ensure that the data was in the correct format. Finally, I added a sorting function to allow the user to sort the table's data by title, plot, cast, runtime, rating or year. With more time, I would like to return to this project and add additional functionality to allow the user to edit or delete data entries.
Noting that the four movies in movieData were directed by Wes Anderson, I styled the page in line with the distinctive aesthetic of his films e.g. the table reflects the design of the titular building of 'The Grand Budapest Hotel'. I chose Courier font throughout the page as this is industry-standard font for screenplays.